public class QueryImpl<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> extends Object implements Query<C,CLS,E>, ProblemAware
The following features are implemented:
| Constructor and Description |
|---|
QueryImpl(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environment,
OCLExpression<C> expr,
Map<CLS,? extends Set<? extends E>> extentMap) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
check(List<?> objList)
Determines whether all of the input objects satisfy the query.
|
boolean |
check(Object obj)
Evaluates the query on an object.
|
Object |
evaluate()
Evaluates the query.
|
List<?> |
evaluate(List<?> objList)
Evaluates the query on the input list.
|
Object |
evaluate(Object obj)
Evaluates the query on the object.
|
EvaluationEnvironment<C,O,P,CLS,E> |
getEvaluationEnvironment()
Obtains the evaluation environment that I use to evaluate OCL expressions.
|
OCLExpression<C> |
getExpression()
Obtains the expression that I evaluate (or check as a boolean constraint).
|
Map<CLS,? extends Set<? extends E>> |
getExtentMap()
Obtains the mapping of classes to their extents (sets of all instances).
|
Diagnostic |
getProblems()
Retrieves the problems available on this problem aware object
|
String |
queryText()
Translates the query back to an OCL text string.
|
<T> List<T> |
reject(List<T> objList)
Determines the subset of input objects that do not satisfy the
query.
|
C |
resultType()
Obtains the OCL result type of the query.
|
<T> List<T> |
select(List<T> objList)
Determines the subset of input objects that satisfy the query.
|
String |
toString() |
public Map<CLS,? extends Set<? extends E>> getExtentMap()
QuerygetExtentMap in interface Query<C,CLS,E>OCL.setExtentMap(java.util.Map<CLS, ? extends java.util.Set<? extends E>>)public OCLExpression<C> getExpression()
QuerygetExpression in interface Query<C,CLS,E>public Object evaluate(Object obj)
Queryevaluate in interface Query<C,CLS,E>obj - an ObjectEObjects, Java objects, a mixture, or even null.
In any case, the results conform to the expression's
result typeQuery.evaluate(),
Query.evaluate(List),
Query.resultType()public Object evaluate()
QueryallInstances()
exclusively for evaluation.evaluate in interface Query<C,CLS,E>EObjects, Java objects, a mixture, or even null.
In any case, the results conform to the expression's
result typeQuery.resultType()public boolean check(Object obj)
Querypublic List<?> evaluate(List<?> objList)
Queryevaluate in interface Query<C,CLS,E>objList - 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()public boolean check(List<?> objList)
Querypublic <T> List<T> select(List<T> objList)
Querypublic <T> List<T> reject(List<T> objList)
Querypublic C resultType()
QueryBoolean.resultType in interface Query<C,CLS,E>public String queryText()
Querypublic EvaluationEnvironment<C,O,P,CLS,E> getEvaluationEnvironment()
QuerygetEvaluationEnvironment in interface Query<C,CLS,E>public Diagnostic getProblems()
ProblemAwaregetProblems in interface ProblemAwarenull in case that no problems are available.Copyright © 2015 Open eHealth Foundation. All rights reserved.