|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.query.conditions.Condition org.eclipse.emf.query.conditions.eobjects.EObjectCondition
public abstract class EObjectCondition
A subclass and the counterpart of a Condition
object to be
used on EObject
arguments. It is the abstract base class for
all EObjectCondition
objects. It provides the basic
functionality and support for EObject
conditions and their
logical connectives to combine other EObjectCondition
object
together. It answers whether a given EObject
satisfies it or
not. An EObjectCondition
object also answers whether the
contents/children of a given EObject
argument are to be pruned
-never visited- or not, in other words, an EObjectCondition is consulted on
whether or not to apply it on the children of a given EObject
,
if the answer is false
, then this EObject
will
not be applied on the children of that particular EObject
. It
is important for clients to know that pruning is treated as a hint only and
is used solely to improve query performance and should not be relied on for
correctness of the EObjectCondition evaluation. An EObjectCondition could not
be consulted at all on pruning issue, and, its response -if it gets consulted-
might not be honoured by the query -especially when having an
EObjectCondition logically combined with another.
This class is intended to be subclassed by clients.
PruneHandler
Field Summary | |
---|---|
static EObjectCondition |
E_FALSE
A constant EObjectCondition object used to indicate a
never satisfied condition |
static EObjectCondition |
E_TRUE
A constant EObjectCondition object used to indicate an
always satisfied condition |
Fields inherited from class org.eclipse.emf.query.conditions.Condition |
---|
FALSE, TRUE |
Constructor Summary | |
---|---|
EObjectCondition()
A simple constructor. |
|
EObjectCondition(PruneHandler pruneHandler)
A constructor that takes in a PruneHandler instance to
use for pruning. |
Method Summary | |
---|---|
EObjectCondition |
AND(EObjectCondition condition)
This operation acts like a logical AND between this EObjectCondition and the argument
EObjectCondition . |
EObjectCondition |
EQUIVALENT(EObjectCondition condition)
This operation acts like a logical Equivalent (if-and-only-if)/( <->) between this EObjectCondition and the argument
EObjectCondition . |
PruneHandler |
getPruneHandler()
A getter for the PrunHandler |
EObjectCondition |
IMPLIES(EObjectCondition condition)
This operation acts like a logical Implies (if-then)/(->) between this EObjectCondition and the argument
EObjectCondition . |
abstract boolean |
isSatisfied(EObject eObject)
Answers whether the argument eObject satisfies this EObjectCondition |
boolean |
isSatisfied(Object object)
Overrides the parent's implementation by simply checking if the argument object is an instance of EObject first, and if so, it
forwards the actual evaluation to the appropriate overloaded version. |
EObjectCondition |
OR(EObjectCondition condition)
This operation acts like a logical OR between this EObjectCondition and the argument
EObjectCondition . |
boolean |
shouldPrune(EObject eObject)
Answers whether or not we should apply this EObjectCondition
on the children of the argument eObject. |
EObjectCondition |
XOR(EObjectCondition condition)
This operation acts like a logical XOR between this EObjectCondition and the argument
EObjectCondition . |
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 |
---|
public static final EObjectCondition E_TRUE
EObjectCondition
object used to indicate an
always satisfied condition
public static final EObjectCondition E_FALSE
EObjectCondition
object used to indicate a
never satisfied condition
Constructor Detail |
---|
public EObjectCondition()
EObject
.
PruneHandler
public EObjectCondition(PruneHandler pruneHandler)
PruneHandler
instance to
use for pruning. This constructor will match any kind of EObject
,
so it is only safe for conditions with E == EObject.
pruneHandler
- The PruneHandler
to use for pruningPruneHandler
Method Detail |
---|
public final PruneHandler getPruneHandler()
PruneHandler
the prune handler used by this
EObjectCondition
public boolean shouldPrune(EObject eObject)
EObjectCondition
on the children of the argument eObject. This call is forwarded to the
installed PruneHandler.
- Parameters:
eObject
- the EObject
to check to see whether to visit its children or not
- Returns:
- boolean
true
if we should prune and false
otherwise
public boolean isSatisfied(Object object)
EObject
first, and if so, it
forwards the actual evaluation to the appropriate overloaded version. If
the argument object does not conform to an EObject
it will
return false
as a result.
isSatisfied
in class Condition
object
- an Object to check if it satisfies this Condition
true
if the argument Object satisfies this
Condition
,false
otherwise.Condition.isSatisfied(java.lang.Object)
public abstract boolean isSatisfied(EObject eObject)
EObjectCondition
eObject
- the EObject
to check
true
if the argument eObject satisfies
this EObjectCondition
public EObjectCondition AND(EObjectCondition condition)
EObjectCondition
and the argument
EObjectCondition
. The returned
EObjectCondition
is a newly created
EObjectCondition
which is satisfied only if both its
constituent EObjectCondition
are. Please note that the
newly compounded Condition
will evaluate this
EObjectCondition
first, and if the result is
true
, it will evaluate the argument
EObjectCondition
: ANDing both results as its own final
result. This means that the argument EObjectCondition
could be short-circuited and might not be evaluated at all.
condition
- a EObjectCondition
to be ANDed with this one.
EObjectCondition
object that
represents the ANDing of this EObjectCondition
with the argument EObjectCondition
.public EObjectCondition OR(EObjectCondition condition)
EObjectCondition
and the argument
EObjectCondition
. The returned
EObjectCondition
is a newly created
EObjectCondition
which is satisfied if either of its
constituent EObjectCondition
is. Please note that the
newly compounded EObjectCondition
will evaluate this
EObjectCondition
first, and if the result is
true
, it won't evaluate the argument
EObjectCondition
and it will return true
as
its final result, if, on the other hand the evaluation of the first
EObjectCondition
is false
, the argument
EObjectCondition
will be evaluated and its returned result
will be ORed with this one's and the resulting boolean will be returned
as the compounded EObjectCondition
own final result. This
means that the argument EObjectCondition
could be
short-circuited and might not be evaluated at all.
condition
- a EObjectCondition
to be ORed with this one.
EObjectCondition
object that
represents the ORing of this EObjectCondition
with
the argument EObjectCondition
.public EObjectCondition XOR(EObjectCondition condition)
EObjectCondition
and the argument
EObjectCondition
. The returned
EObjectCondition
is a newly created
EObjectCondition
which is satisfied if XORing its
constituent EObjectCondition
is.
condition
- a EObjectCondition
to be XORed with this one.
EObjectCondition
object that
represents the XORing of this EObjectCondition
with the argument EObjectCondition
.public EObjectCondition IMPLIES(EObjectCondition condition)
EObjectCondition
and the argument
EObjectCondition
. The returned
EObjectCondition
is a newly created
EObjectCondition
which is satisfied if the result of this
EObjectCondition
's evaluation is false
,
in which case the argument EObjectCondition
will not be
evaluated at all, or, if the both its constituent
EObjectCondition
evaluate to true
.
condition
- a EObjectCondition
to be used in the Imply
relation with this one.
EObjectCondition
object that
represents the Imply logical relation between this
EObjectCondition
and the argument
EObjectCondition
.public EObjectCondition EQUIVALENT(EObjectCondition condition)
EObjectCondition
and the argument
EObjectCondition
. The returned
EObjectCondition
is a newly created Condition
which is satisfied if the result of both its constituent
EObjectConditions evaluate to the same value.(both are true
,
or both are false
)
condition
- a EObjectCondition
to be used in the Equivalent
relation with this one.
EObjectCondition
object that
represents the Equivalent logical relation between this
EObjectCondition
and the argument
EObjectCondition
.
|
Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |