org.eclipse.emf.query.conditions.eobjects
Class EObjectTypeRelationCondition

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.EObjectTypeRelationCondition
Direct Known Subclasses:
EObjectInstanceCondition

public class EObjectTypeRelationCondition
extends EObjectCondition

An EObjectCondition specialization to be used for evaluating the inheritance/type relationship of an EObject to another using the EObjects' EClasses. For example it could be used to find if a given EObject is a subtype/supertype of another EObject.

See Also:
TypeRelation

Field Summary
static EObjectTypeRelationCondition UNDEFINED
          A constant EObjectTypeRelationCondition object used to indicate that the type relationship is undefined and hence it is always satisfied.
 
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
EObjectTypeRelationCondition(EClass type)
          A Simple constructor, it initializes the EObjectTypeRelationCondition with the given EClass.
EObjectTypeRelationCondition(EClass type, PruneHandler pruneHandler)
          A constructor, it initializes the EObjectTypeRelationCondition with the given EClass.
EObjectTypeRelationCondition(EClass type, TypeRelation typeRelationKind)
          A constructor, it initializes the EObjectTypeRelationCondition with the given EClass and the TypeRelation specified.
EObjectTypeRelationCondition(EClass type, TypeRelation typeRelationKind, PruneHandler pruneHandler)
          A constructor, it initializes the EObjectTypeRelationCondition with the given EClass, the TypeRelation and the PruneHandler specified.
 
Method Summary
 boolean isSatisfied(EObject eObject)
          Evaluates this EObjectTypeRelationCondition, basically it answers the following question: Is the passed eObject's EClass is a TypeRelation to this EObjectTypeRelationCondition's primary type/ EClass?
 
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
 

Field Detail

UNDEFINED

public static final EObjectTypeRelationCondition UNDEFINED
A constant EObjectTypeRelationCondition object used to indicate that the type relationship is undefined and hence it is always satisfied.

Constructor Detail

EObjectTypeRelationCondition

public EObjectTypeRelationCondition(EClass type)
A Simple constructor, it initializes the EObjectTypeRelationCondition with the given EClass. It defaults to using TypeRelation.SAMETYPE_LITERAL as its relationship of interest and PruneHandler.NEVER to handle pruning

Parameters:
type - The EClass the primary type to check against

EObjectTypeRelationCondition

public EObjectTypeRelationCondition(EClass type,
                                    PruneHandler pruneHandler)
A constructor, it initializes the EObjectTypeRelationCondition with the given EClass. It defaults to using TypeRelation.SAMETYPE_LITERAL as its relationship of interest.

Parameters:
type - The EClass the primary type to check against
pruneHandler - The prune handler

EObjectTypeRelationCondition

public EObjectTypeRelationCondition(EClass type,
                                    TypeRelation typeRelationKind)
A constructor, it initializes the EObjectTypeRelationCondition with the given EClass and the TypeRelation specified. It defaults to using PruneHandler.NEVER to handle pruning

Parameters:
type - The EClass the primary type to check against
typeRelationKind - The relationship kind between the primary type argument and other EObjects to test for when evaluating this EObjectTypeRelationCondition.

EObjectTypeRelationCondition

public EObjectTypeRelationCondition(EClass type,
                                    TypeRelation typeRelationKind,
                                    PruneHandler pruneHandler)
A constructor, it initializes the EObjectTypeRelationCondition with the given EClass, the TypeRelation and the PruneHandler specified.

Parameters:
type - The EClass the primary type to check against
typeRelationKind - typeRelationKind The relationship kind between the primary type argument and other EObjects to test for when evaluating this EObjectTypeRelationCondition.
pruneHandler - The prune handler
Method Detail

isSatisfied

public boolean isSatisfied(EObject eObject)
Evaluates this EObjectTypeRelationCondition, basically it answers the following question: Is the passed eObject's EClass is a TypeRelation to this EObjectTypeRelationCondition's primary type/ EClass?

Specified by:
isSatisfied in class EObjectCondition
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)

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