org.eclipse.emf.query.conditions.eobjects.structuralfeatures
Class EObjectStructuralFeatureValueCondition

java.lang.Object
  extended by org.eclipse.emf.query.conditions.Condition
      extended by org.eclipse.emf.query.conditions.eobjects.EObjectCondition
          extended by org.eclipse.emf.query.conditions.eobjects.structuralfeatures.EObjectStructuralFeatureCondition
              extended by org.eclipse.emf.query.conditions.eobjects.structuralfeatures.EObjectStructuralFeatureValueCondition
Direct Known Subclasses:
EObjectAttributeValueCondition, EObjectReferenceValueCondition

public abstract class EObjectStructuralFeatureValueCondition
extends EObjectStructuralFeatureCondition

An EObjectStructuralFeatureCondition specialization and the base class of conditions that test for the values held by the various EStructuralFeature. This condition can handle both single-valued and multiple-valued EStructuralFeatures. It is important to know the following about how evaluation is carried out by this condition:

See Also:
IEStructuralFeatureValueGetter, ConditionPolicy

Field Summary
 
Fields inherited from class org.eclipse.emf.query.conditions.eobjects.EObjectCondition
E_FALSE, E_TRUE
 
Fields inherited from class org.eclipse.emf.query.conditions.Condition
FALSE, TRUE
 
Constructor Summary
EObjectStructuralFeatureValueCondition(PruneHandler pruneHandler, EObjectCondition contextEObjectCondition, EStructuralFeature feature, IEStructuralFeatureValueGetter eStructuralFeatureValueGetter, boolean resolve, Condition valueCondition, ConditionPolicy policy)
          The constructor of this EObjectStructuralFeatureValueCondition object, it initializes it with the proper values.
 
Method Summary
 ConditionPolicy getPolicy()
          Accessor method for the policy argument used in initialization of this condition
protected  EObjectCondition getStructuralFeatureCondition()
          Accessor method for the the EObjectCondition that is used for actual testing of EStructuralFeature's value in order to determine if it satisfies this condition or not.
protected  boolean isResolve()
          Accessor method for the resolve argument used in initialization of this condition
 boolean isSatisfied(EObject eObject)
          Checks the value held by the initialization EStructuralFeature to see if it satisfies this condition.
 
Methods inherited from class org.eclipse.emf.query.conditions.eobjects.structuralfeatures.EObjectStructuralFeatureCondition
getFeature, getFeatures
 
Methods inherited from class org.eclipse.emf.query.conditions.eobjects.EObjectCondition
AND, EQUIVALENT, getPruneHandler, IMPLIES, isSatisfied, OR, shouldPrune, XOR
 
Methods inherited from class org.eclipse.emf.query.conditions.Condition
AND, EQUIVALENT, IMPLIES, OR, XOR
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EObjectStructuralFeatureValueCondition

public EObjectStructuralFeatureValueCondition(PruneHandler pruneHandler,
                                              EObjectCondition contextEObjectCondition,
                                              EStructuralFeature feature,
                                              IEStructuralFeatureValueGetter eStructuralFeatureValueGetter,
                                              boolean resolve,
                                              Condition valueCondition,
                                              ConditionPolicy policy)
The constructor of this EObjectStructuralFeatureValueCondition object, it initializes it with the proper values.

Parameters:
pruneHandler - The PruneHandler to use
contextEObjectCondition - an optional EObjectCondition to use to check the context EObject which is the EObject passed to the isSatisfied(EObject) method for evaluation, which also serves as the context within which the EStructuralFeature's value exists -and hence the name. This contextEObjectCondition is optional and hence could be null
feature - The EStructuralFeature to check its value
eStructuralFeatureValueGetter - The IEStructuralFeatureValueGetter to be used by this EObjectStructuralFeatureValueCondition to extract the value of the EStructuralFeature of interest. It serves as a layer of indirection to allow clients to intervene between this condition object and the way it extracts the EStructuralFeature's value so as to allow for possible messaging of such value before subjecting it to evaluation.
resolve - A boolean flag to instruct this condition on whether or not it should resolve a given value before evaluating it or not. This flag will be passed to the eStructuralFeatureValueGetter since it is the one responsible for getting EStructuralFeatures values.
valueCondition - The primary condition to be employed in checking the EStructuralFeatures values
policy - The ConditionPolicy to be used to determine how to interpret the evaluation results as returned by the valueCondition especially in the case of EStructuralFeatures that hold collection of values.
Method Detail

isSatisfied

public boolean isSatisfied(EObject eObject)
Checks the value held by the initialization EStructuralFeature to see if it satisfies this condition. If the eObject passed for evaluation does not have the EStructuralFeature in question the result of this evaluation will be false.

Overrides:
isSatisfied in class EObjectStructuralFeatureCondition
Parameters:
eObject - the EObject to check
Returns:
boolean true if the argument eObject satisfies this EObjectCondition
See Also:
EObjectCondition.isSatisfied(org.eclipse.emf.ecore.EObject)

getStructuralFeatureCondition

protected final EObjectCondition getStructuralFeatureCondition()
Accessor method for the the EObjectCondition that is used for actual testing of EStructuralFeature's value in order to determine if it satisfies this condition or not.

Returns:
EObjectCondition the EObjectCondition used to evaluate the EStructuralFeature

isResolve

protected final boolean isResolve()
Accessor method for the resolve argument used in initialization of this condition

Returns:
boolean the value resolve argument used in initialization of this condition

getPolicy

public final ConditionPolicy getPolicy()
Accessor method for the policy argument used in initialization of this condition

Returns:
ConditionPolicy the policy used in evaluation

Copyright 2002, 2007 IBM Corporation and others.
All Rights Reserved.