public class QueryImpl extends java.lang.Object implements Query, ProblemAware
The following features are implemented:
| Constructor and Description |
|---|
QueryImpl(OCL ocl,
ExpressionInOCL specification) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
java.lang.Object |
evaluate()
Evaluates the query.
|
java.util.List<?> |
evaluate(java.util.List<?> objList)
Evaluates the query on the input list.
|
java.lang.Object |
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).
|
DomainModelManager |
getModelManager()
Obtains the mapping of classes to their extents (sets of all instances).
|
OCL |
getOCL()
Obtains the
OCL that created me. |
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.
|
<T> java.util.List<T> |
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.
|
<T> java.util.List<T> |
select(java.util.List<T> objList)
Determines the subset of input objects that satisfy the query.
|
java.lang.String |
toString() |
public QueryImpl(@NonNull
OCL ocl,
@NonNull
ExpressionInOCL specification)
environment - expr - modelManager - may be null, in which case I will use my
evaluation environment to create a dynamic extent mappublic boolean check(java.lang.Object obj)
Querycheck in interface Queryobj - an Object or null if the query
does not require an OCL 'self' contexttrue or false according to
whether the constraint is metQuery.check(List)public boolean check(java.util.List<?> objList)
Querycheck in interface QueryobjList - a list of objects to evaluate the constraint ontrue if all of the objects satisfy
the constraint (including the trivial case of an empty input list);
false, otherwiseQuery.check(Object)public java.lang.Object evaluate()
throws DomainException
QueryallInstances()
exclusively for evaluation.evaluate in interface QueryEObjects, Java objects, a mixture, or even null.
In any case, the results conform to the expression's
result typeDomainExceptionQuery.resultType()public java.lang.Object evaluate(java.lang.Object obj)
throws DomainException
Queryevaluate in interface Queryobj - an ObjectEObjects, Java objects, a mixture, or even null.
In any case, the results conform to the expression's
result typeDomainExceptionQuery.evaluate(),
Query.evaluate(List),
Query.resultType()public java.util.List<?> evaluate(java.util.List<?> objList)
Queryevaluate in interface QueryobjList - a list of objects to evaluate the query onobjects. 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 typeQuery.evaluate(Object),
Query.resultType()@NonNull public EvaluationEnvironment getEvaluationEnvironment()
QuerygetEvaluationEnvironment in interface Querypublic OCLExpression getExpression()
QuerygetExpression in interface Query@NonNull public DomainModelManager getModelManager()
QuerygetModelManager in interface QueryOCLBase#setModelManager@NonNull public OCL getOCL()
Query
Obtains the OCL that created me.
public org.eclipse.emf.common.util.Diagnostic getProblems()
ProblemAwaregetProblems in interface ProblemAwarenull in case that no problems are available.public java.lang.String queryText()
Querypublic <T> java.util.List<T> reject(java.util.List<T> objList)
Querypublic Type resultType()
QueryBoolean.resultType in interface Querypublic <T> java.util.List<T> select(java.util.List<T> objList)
Querypublic java.lang.String toString()
toString in class java.lang.Object