|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ocl.examples.pivot.utilities.QueryBaseImpl
public class QueryBaseImpl
An implementation of the model object 'Query'.
The following features are implemented:
Constructor Summary | |
---|---|
QueryBaseImpl(Environment environment,
ExpressionInOcl specification,
ModelManager modelManager)
|
Method Summary | ||
---|---|---|
boolean |
check(java.util.List<?> objList)
Determines whether all of the input objects satisfy the query. |
|
boolean |
check(java.lang.Object obj)
Evaluates the query on an object. |
|
Value |
evaluate()
Evaluates the query. |
|
java.util.List<?> |
evaluate(java.util.List<?> objList)
Evaluates the query on the input list. |
|
Value |
evaluate(java.lang.Object obj)
Evaluates the query on the object. |
|
EvaluationEnvironment |
getEvaluationEnvironment()
Obtains the evaluation environment that I use to evaluate OCL expressions. |
|
OclExpression |
getExpression()
Obtains the expression that I evaluate (or check as a boolean constraint). |
|
ModelManager |
getModelManager()
Obtains the mapping of classes to their extents (sets of all instances). |
|
org.eclipse.emf.common.util.Diagnostic |
getProblems()
Retrieves the problems available on this problem aware object |
|
java.lang.String |
queryText()
Translates the query back to an OCL text string. |
|
|
reject(java.util.List<T> objList)
Determines the subset of input objects that do not satisfy the query. |
|
Type |
resultType()
Obtains the OCL result type of the query. |
|
|
select(java.util.List<T> objList)
Determines the subset of input objects that satisfy the query. |
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public QueryBaseImpl(Environment environment, ExpressionInOcl specification, ModelManager modelManager)
environment
- expr
- modelManager
- may be null
, in which case I will use my
evaluation environment to create a dynamic extent mapMethod Detail |
---|
public ModelManager getModelManager()
QueryBase
getModelManager
in interface QueryBase
OCLBase.setModelManager(org.eclipse.ocl.examples.pivot.evaluation.ModelManager)
public OclExpression getExpression()
QueryBase
getExpression
in interface QueryBase
public Value evaluate(java.lang.Object obj) throws EvaluationException
QueryBase
evaluate
in interface QueryBase
obj
- an Object
EObject
s, Java objects, a mixture, or even null
.
In any case, the results conform to the expression's
result type
EvaluationException
QueryBase.evaluate()
,
QueryBase.evaluate(List)
,
QueryBase.resultType()
public Value evaluate() throws EvaluationException
QueryBase
allInstances()
exclusively for evaluation.
evaluate
in interface QueryBase
EObject
s, Java objects, a mixture, or even null
.
In any case, the results conform to the expression's
result type
EvaluationException
QueryBase.resultType()
public boolean check(java.lang.Object obj)
QueryBase
check
in interface QueryBase
obj
- an Object
or null
if the query
does not require an OCL 'self' context
true
or false
according to
whether the constraint is metQueryBase.check(List)
public java.util.List<?> evaluate(java.util.List<?> objList)
QueryBase
evaluate
in interface QueryBase
objList
- a list of objects to evaluate the query on
objects
. Note that result elements may, themselves,
be collections of multiple results for a single input object.
In any case, the results conform to the expression's
result typeQueryBase.evaluate(Object)
,
QueryBase.resultType()
public boolean check(java.util.List<?> objList)
QueryBase
check
in interface QueryBase
objList
- a list of objects to evaluate the constraint on
true
if all of the objects
satisfy
the constraint (including the trivial case of an empty input list);
false
, otherwiseQueryBase.check(Object)
public <T> java.util.List<T> select(java.util.List<T> objList)
QueryBase
select
in interface QueryBase
objList
- a list of objects to evaluate the constraint on
objects
that
satisfy the constraintpublic <T> java.util.List<T> reject(java.util.List<T> objList)
QueryBase
reject
in interface QueryBase
objList
- a list of objects to evaluate the constraint on
objects
that
do not satisfy the constraintpublic Type resultType()
QueryBase
Boolean
.
resultType
in interface QueryBase
public java.lang.String queryText()
QueryBase
queryText
in interface QueryBase
public EvaluationEnvironment getEvaluationEnvironment()
QueryBase
getEvaluationEnvironment
in interface QueryBase
public org.eclipse.emf.common.util.Diagnostic getProblems()
ProblemAware
getProblems
in interface ProblemAware
null
in case that no problems are available.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |