org.caleigo.core
Class RelationQualifier

java.lang.Object
  extended byorg.caleigo.core.Qualifier
      extended byorg.caleigo.core.RelationQualifier
All Implemented Interfaces:
java.io.Serializable

public class RelationQualifier
extends Qualifier

The RelationSelector represents a binary relation between two data values.

Version:
1.00
Author:
Dennis Zikovic
See Also:
RelationType, Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.caleigo.core.Qualifier
Qualifier.RelayListener
 
Constructor Summary
RelationQualifier(IFieldDescriptor fieldDescriptor, java.lang.Object relationValue)
          Creates a new RelationQualifier with realtion type set to EQUAL.
RelationQualifier(IFieldDescriptor fieldDescriptor, RelationType relationType, java.lang.Object relationValue)
          Creates a new RelationQualifier.
 
Method Summary
 boolean canDirectlyQualify(IEntityDescriptor entityDescriptor)
          This abstract method must return true if the qualifier can select entities of the type defined by the provided entity descriptor without the nead of any complementary data.
 boolean canQualify(IEntityDescriptor entityDescriptor)
          This method returns true if the qualifier can select entities of the type defined by the provided entity descriptor.
 boolean canUniquelyQualify(IEntityDescriptor entityDescriptor)
          This method returns true if the qualifier can uniquely select entities of the type defined by the provided entity descriptor.
 boolean doesQualify(IEntity entity)
          This method returns true if the qualifier does select the provided entity object.
 java.lang.String getEntityIdentity()
          Access method that returns the entity identity object that defines what entity instance the field in the Qualifier addresses and should be applied on.
 IFieldDescriptor getFieldDescriptor()
          Access method that returns the IFieldDescriptor that defines the data that are to be matched/related by the contained data in the qualifier.
 java.lang.String getFieldValueEntityIdentity()
          Access method that returns the entity identity object that defines what entity instance the field in the Qualifier addresses and should be applied on.
 RelationType getRelationType()
          Access method that returns the contained RelationType object that defines how the mapped and contained data in the Qualifier should be compared.
 java.lang.Object getRelationValue()
          Access method that returns the contained value that are used in relation with the field value which is adressed by the conained IFieldDescriptor.
 boolean isFieldToFieldRelation()
          Returns true if the qualifier defines a field to field relation.
 void setEntityIdentity(java.lang.String entityIdentity)
          Mutation method that sets the entity identity object that defines what entity instance the field in the Qualifier adresses and should be applied on.
 void setFieldDescriptor(IFieldDescriptor fieldDescriptor)
          Mutation method that updates the IFieldDescriptor that defines the data that are to be matched/related by the contained data in the qualifier.
 void setFieldValueEntityIdentity(java.lang.String entityIdentity)
          Mutation method that sets the entity identity object that defines what entity instance the field in the Qualifier adresses and should be applied on.
 void setRelationType(RelationType relationType)
          Mutation method that updates the contained RelationType object that defines how the mapped and contained data in the Qualifier should be compared.
 void setRelationValue(java.lang.Object relationValue)
          Mutation method that sets the contained value that are used in relation with the field value which is adressed by the conained IFieldDescriptor.
 java.lang.String toString()
          The toString method returns an "abstract" expression of what the qualifier selects.
 
Methods inherited from class org.caleigo.core.Qualifier
addQualifierListener, and, and, and, combine, create, create, fireContentChangedEvent, fireQualifierEvent, fireStructureChangedEvent, negate, or, or, or, removeQualifierListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RelationQualifier

public RelationQualifier(IFieldDescriptor fieldDescriptor,
                         java.lang.Object relationValue)
Creates a new RelationQualifier with realtion type set to EQUAL. Note that the relationValue can be a IFieldDescriptor.

Parameters:
fieldDescriptor - The field descriptor to be qualified.
relationValue - The value to compare the field with.

RelationQualifier

public RelationQualifier(IFieldDescriptor fieldDescriptor,
                         RelationType relationType,
                         java.lang.Object relationValue)
Creates a new RelationQualifier. Note that the relationValue can be a IFieldDescriptor.

Parameters:
fieldDescriptor - The field descriptor to be qualified.
relationType - The relation type to be used.
relationValue - The value to compare the field with.
Method Detail

doesQualify

public boolean doesQualify(IEntity entity)
This method returns true if the qualifier does select the provided entity object.

Specified by:
doesQualify in class Qualifier

canQualify

public boolean canQualify(IEntityDescriptor entityDescriptor)
This method returns true if the qualifier can select entities of the type defined by the provided entity descriptor.

Specified by:
canQualify in class Qualifier

canDirectlyQualify

public boolean canDirectlyQualify(IEntityDescriptor entityDescriptor)
This abstract method must return true if the qualifier can select entities of the type defined by the provided entity descriptor without the nead of any complementary data. No other information than can be accessed through the provided entity descriptor should be neaded if this method returns true. This validates that the doesQualify method can be called for the called qualifier.

Specified by:
canDirectlyQualify in class Qualifier

canUniquelyQualify

public boolean canUniquelyQualify(IEntityDescriptor entityDescriptor)
This method returns true if the qualifier can uniquely select entities of the type defined by the provided entity descriptor. If that is the case then the qualifier is an identity qualifier and can never qualify more then a single entity instance of the specified type.

Specified by:
canUniquelyQualify in class Qualifier

toString

public java.lang.String toString()
The toString method returns an "abstract" expression of what the qualifier selects. Note that this expresion is only intended for visual aid and is not a valid SQL expresion.


isFieldToFieldRelation

public boolean isFieldToFieldRelation()
Returns true if the qualifier defines a field to field relation.


getFieldDescriptor

public IFieldDescriptor getFieldDescriptor()
Access method that returns the IFieldDescriptor that defines the data that are to be matched/related by the contained data in the qualifier.


setFieldDescriptor

public void setFieldDescriptor(IFieldDescriptor fieldDescriptor)
Mutation method that updates the IFieldDescriptor that defines the data that are to be matched/related by the contained data in the qualifier.


getRelationType

public RelationType getRelationType()
Access method that returns the contained RelationType object that defines how the mapped and contained data in the Qualifier should be compared.


setRelationType

public void setRelationType(RelationType relationType)
Mutation method that updates the contained RelationType object that defines how the mapped and contained data in the Qualifier should be compared.


getRelationValue

public java.lang.Object getRelationValue()
Access method that returns the contained value that are used in relation with the field value which is adressed by the conained IFieldDescriptor. Note that this value may in turn be IFieldDescriptor that defines another field value in a targeted entity type.


setRelationValue

public void setRelationValue(java.lang.Object relationValue)
Mutation method that sets the contained value that are used in relation with the field value which is adressed by the conained IFieldDescriptor. Note that this value may in turn be IFieldDescriptor that defines another field value in a targeted entity type.


getEntityIdentity

public java.lang.String getEntityIdentity()
Access method that returns the entity identity object that defines what entity instance the field in the Qualifier addresses and should be applied on. If no identity is set the default identity is returned.


setEntityIdentity

public void setEntityIdentity(java.lang.String entityIdentity)
Mutation method that sets the entity identity object that defines what entity instance the field in the Qualifier adresses and should be applied on. If no identity is set the default identity will be used.


getFieldValueEntityIdentity

public java.lang.String getFieldValueEntityIdentity()
Access method that returns the entity identity object that defines what entity instance the field in the Qualifier addresses and should be applied on. If no identity is set the default identity is returned.


setFieldValueEntityIdentity

public void setFieldValueEntityIdentity(java.lang.String entityIdentity)
Mutation method that sets the entity identity object that defines what entity instance the field in the Qualifier adresses and should be applied on. If no identity is set the default identity will be used.



Copyright © 2005 Caleigo. All Rights Reserved.