public class QueryImpl extends Object implements Query, ProblemAware
Constructor and Description |
---|
QueryImpl(OCL ocl,
ExpressionInOCL query) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkBoxed(Iterable<?> boxedObjects)
Determines whether all of the boxedObjects satisfy the query.
|
boolean |
checkBoxed(Object boxedObject)
Evaluates the query on a boxedObject.
|
boolean |
checkEcore(Iterable<?> ecoreObjects)
Determines whether all of the ecoreObjects satisfy the query.
|
boolean |
checkEcore(Object ecoreObject)
Evaluates the query on an ecoreObject.
|
List<?> |
evaluateBoxed(Iterable<?> boxedObjects)
Evaluates the query on each of boxedObjects to return a list of boxedResults.
|
Object |
evaluateBoxed(Object boxedValue)
Evaluates the query on the boxedObject to return a boxedResult.
|
<any> |
evaluateEcore(Class<?> instanceClass,
Iterable<?> ecoreObjects)
Evaluates the query on each of ecoreObjects to return a list of ecoreResults coerced, if non-null, to instanceClass.
|
Object |
evaluateEcore(Class<?> instanceClass,
Object ecoreObject)
Evaluates the query on the ecoreObject to return an ecoreResult coerced, if non-null, to instanceClass.
|
<any> |
evaluateEcore(Iterable<?> ecoreObjects)
Evaluates the query on each of ecoreObjects to return a list of ecoreResults using Integer/Double for numerics.
|
Object |
evaluateEcore(Object ecoreObject)
Evaluates the query on the ecoreObject to return an ecoreResult using Integer/Double for numerics.
|
Object |
evaluateUnboxed(Object unboxedObject)
Evaluates the query on the unboxedObject to return an unboxedResult.
|
EvaluationEnvironment |
getEvaluationEnvironment(Object unboxedObject)
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).
|
OCL |
getOCL()
Obtains the
OCL that created me. |
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> |
rejectEcore(Iterable<T> ecoreObjects)
Determines the subset of ecoreObjects that do not satisfy the
query.
|
Type |
resultType()
Obtains the OCL result type of the query.
|
<T> List<T> |
selectEcore(Iterable<T> ecoreObjects)
Determines the subset of ecoreObjects that satisfy the query.
|
String |
toString() |
public QueryImpl(OCL ocl, ExpressionInOCL query)
public boolean checkBoxed(Object boxedObject)
Query
checkBoxed
in interface Query
boxedObject
- an Object
or null
if the query
does not require an OCL 'self' contexttrue
or false
according to
whether the constraint is metpublic boolean checkBoxed(Iterable<?> boxedObjects)
Query
checkBoxed
in interface Query
boxedObjects
- 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
, otherwisepublic boolean checkEcore(Object ecoreObject)
Query
checkEcore
in interface Query
ecoreObject
- an Object
or null
if the query
does not require an OCL 'self' contexttrue
or false
according to
whether the constraint is metpublic boolean checkEcore(Iterable<?> ecoreObjects)
Query
checkEcore
in interface Query
ecoreObjects
- 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
, otherwisepublic Object evaluateBoxed(Object boxedValue)
Query
evaluateBoxed
in interface Query
public List<?> evaluateBoxed(Iterable<?> boxedObjects)
Query
evaluateBoxed
in interface Query
public Object evaluateEcore(Object ecoreObject) throws EvaluationException
Query
evaluateEcore
in interface Query
EvaluationException
public Object evaluateEcore(Class<?> instanceClass, Object ecoreObject) throws EvaluationException
Query
evaluateEcore
in interface Query
EvaluationException
public <any> evaluateEcore(Iterable<?> ecoreObjects) throws EvaluationException
Query
evaluateEcore
in interface Query
EvaluationException
public <any> evaluateEcore(Class<?> instanceClass, Iterable<?> ecoreObjects)
Query
evaluateEcore
in interface Query
public Object evaluateUnboxed(Object unboxedObject) throws EvaluationException
Query
evaluateUnboxed
in interface Query
EvaluationException
public EvaluationEnvironment getEvaluationEnvironment(Object unboxedObject)
Query
getEvaluationEnvironment
in interface Query
public OCLExpression getExpression()
Query
getExpression
in interface Query
public OCL getOCL()
Query
Obtains the OCL
that created me.
public Diagnostic getProblems()
ProblemAware
getProblems
in interface ProblemAware
null
in case that no problems are available.public String queryText()
Query
public <T> List<T> rejectEcore(Iterable<T> ecoreObjects)
Query
rejectEcore
in interface Query
ecoreObjects
- a list of objects to evaluate the constraint onobjects
that
do not satisfy the constraintpublic Type resultType()
Query
Boolean
.resultType
in interface Query
public <T> List<T> selectEcore(Iterable<T> ecoreObjects)
Query
selectEcore
in interface Query
ecoreObjects
- a list of objects to evaluate the constraint onobjects
that
satisfy the constraintCopyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.