org.caleigo.core
Interface IEntityRelationPath

All Known Implementing Classes:
EntityRelationPath

public interface IEntityRelationPath

The IEntityRelationPath interface is used to define a path between two different IEntityDescriptor objects.

Version:
1.00
Author:
Dennis Zikovic

Field Summary
static int MANY
          Constant value returned by the getCardinality methods.
static int ONE
          Constant value returned by the getCardinality methods.
 
Method Summary
 java.lang.String convertToString()
          Returns a string representation of this IEntirtyRelationPath that can be used to restore this IEntirtyRelationPath.
 IEntityDescriptor getFirstEntityDescriptor()
          Returns the IEntityDescriptor object that marks is the start point of the relation path.
 java.util.Iterator getFirstFieldDescriptors()
          Returns the IFieldDescriptor objects that marks is the start point of the relation path.
 IEntityRelation getFirstRelation()
          Returns the IEntityRelation object that marks is the start point of the relation path.
 int getForwardCardinality()
          Access method that returns the cardinality for the IEntityDescriptor object at the begining of the relation path.
 IEntityDescriptor getLastEntityDescriptor()
          Returns the IEntityDescriptor object that marks is the end point of the relation path.
 java.util.Iterator getLastFieldDescriptors()
          Returns the IFieldDescriptor objects that marks is the end point of the relation path.
 IEntityRelation getLastRelation()
          Returns the IEntityRelation object that marks is the end point of the relation path.
 IEntityRelation getRelation(int index)
          Access method that returns the indexed IEntityRelation object.
 int getRelationCount()
          Access method that returns the number of IEntityRelation objects that defines the relation path.
 Qualifier getRelationQualifier()
          Returns a Qualifier that satisfies all the field requirements that have to be satisfied to define a relation between the first and last entity descriptor of the relation path.
 java.util.Iterator getRelations()
          Access method that returns all IEntityRelation objects in the path in the form of an Iterator.
 int getReverseCardinality()
          Access method that returns the cardinality for the IEntityDescriptor object at the end of the relation path.
 boolean isFirstRelationByReference()
          Returns true if the start relation starts on the reference side.
 boolean isLastRelationByReference()
          Returns true if the last relation starts on the reference side.
 boolean isRelatedByPath(IEntityDescriptor descriptor1, IEntityDescriptor descriptor2)
          This help method returns true if the provided entity descriptors are related "along" the called relation path.
 boolean isRelationByReference(int index)
          Returns true if the indexed relation is followed in the forward directiona long the path by the reference side of the entity relation.
 

Field Detail

ONE

public static final int ONE
Constant value returned by the getCardinality methods. The constant signifies that first/last side of the path can have one and only one refered entity for a single entity on the other side of the relation path.

See Also:
Constant Field Values

MANY

public static final int MANY
Constant value returned by the getCardinality methods. The constant signifies that first/last side of the path can have many refered entities for a single entity on the other side of the relation path.

See Also:
Constant Field Values
Method Detail

getFirstRelation

public IEntityRelation getFirstRelation()
Returns the IEntityRelation object that marks is the start point of the relation path.


isFirstRelationByReference

public boolean isFirstRelationByReference()
Returns true if the start relation starts on the reference side. False would mean that the relation starts on the target side.


getFirstEntityDescriptor

public IEntityDescriptor getFirstEntityDescriptor()
Returns the IEntityDescriptor object that marks is the start point of the relation path.


getFirstFieldDescriptors

public java.util.Iterator getFirstFieldDescriptors()
Returns the IFieldDescriptor objects that marks is the start point of the relation path. The descriptors are returned as an Iterator.


getLastRelation

public IEntityRelation getLastRelation()
Returns the IEntityRelation object that marks is the end point of the relation path.


isLastRelationByReference

public boolean isLastRelationByReference()
Returns true if the last relation starts on the reference side. False would mean that the relation ends on the target side.


getLastEntityDescriptor

public IEntityDescriptor getLastEntityDescriptor()
Returns the IEntityDescriptor object that marks is the end point of the relation path.


getLastFieldDescriptors

public java.util.Iterator getLastFieldDescriptors()
Returns the IFieldDescriptor objects that marks is the end point of the relation path. The descriptors are returned as an Iterator.


getRelationCount

public int getRelationCount()
Access method that returns the number of IEntityRelation objects that defines the relation path.


getRelation

public IEntityRelation getRelation(int index)
Access method that returns the indexed IEntityRelation object. The index is related to the begining/first entity of the path meaning that relation zero is the relation that links to first entity descriptor in the path.


isRelationByReference

public boolean isRelationByReference(int index)
Returns true if the indexed relation is followed in the forward directiona long the path by the reference side of the entity relation. False would mean that the relation is followed by the target side.


getRelations

public java.util.Iterator getRelations()
Access method that returns all IEntityRelation objects in the path in the form of an Iterator.


getForwardCardinality

public int getForwardCardinality()
Access method that returns the cardinality for the IEntityDescriptor object at the begining of the relation path. The returned value is one of the constants ONE or MANY that signifies the number of entities a single entity on the end-side of the relation path can refer to.


getReverseCardinality

public int getReverseCardinality()
Access method that returns the cardinality for the IEntityDescriptor object at the end of the relation path. The returned value is one of the constants ONE or MANY that signifies the number of entities a single entity on the start-side of the relation path can refer to.


getRelationQualifier

public Qualifier getRelationQualifier()
Returns a Qualifier that satisfies all the field requirements that have to be satisfied to define a relation between the first and last entity descriptor of the relation path.


isRelatedByPath

public boolean isRelatedByPath(IEntityDescriptor descriptor1,
                               IEntityDescriptor descriptor2)
This help method returns true if the provided entity descriptors are related "along" the called relation path. The order of the descriptors are irelevant. The provided entity descriptors does not have to be the same as the end node descriptors to be related along the path. but they must atleast partially contain the field descriptors that does define the start and end connections for the path at the end-nodes.

Note that the descriptors are are only considered to be related "along the path" if they satisfies the end-node field requriments for relationship. In other words the ENTIRE path must followed for this method to consider the descriptors as related.


convertToString

public java.lang.String convertToString()
Returns a string representation of this IEntirtyRelationPath that can be used to restore this IEntirtyRelationPath. It is recommended that implementing classes declares a static factory method that takes this string as a parameter.



Copyright © 2005 Caleigo. All Rights Reserved.