public class QueryImpl extends java.lang.Object implements Query, ProblemAware
Constructor and Description |
---|
QueryImpl(OCL ocl,
ExpressionInOCL query) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkBoxed(java.lang.Iterable<?> boxedObjects)
Determines whether all of the boxedObjects satisfy the query.
|
boolean |
checkBoxed(java.lang.Object boxedObject)
Evaluates the query on a boxedObject.
|
boolean |
checkEcore(java.lang.Iterable<?> ecoreObjects)
Determines whether all of the ecoreObjects satisfy the query.
|
boolean |
checkEcore(java.lang.Object ecoreObject)
Evaluates the query on an ecoreObject.
|
java.util.List<?> |
evaluateBoxed(java.lang.Iterable<?> boxedObjects)
Evaluates the query on each of boxedObjects to return a list of boxedResults.
|
java.lang.Object |
evaluateBoxed(java.lang.Object boxedValue)
Evaluates the query on the boxedObject to return a boxedResult.
|
org.eclipse.emf.common.util.EList<?> |
evaluateEcore(java.lang.Class<?> instanceClass,
java.lang.Iterable<?> ecoreObjects)
Evaluates the query on each of ecoreObjects to return a list of ecoreResults coerced, if non-null, to instanceClass.
|
java.lang.Object |
evaluateEcore(java.lang.Class<?> instanceClass,
java.lang.Object ecoreObject)
Evaluates the query on the ecoreObject to return an ecoreResult coerced, if non-null, to instanceClass.
|
org.eclipse.emf.common.util.EList<?> |
evaluateEcore(java.lang.Iterable<?> ecoreObjects)
Evaluates the query on each of ecoreObjects to return a list of ecoreResults using Integer/Double for numerics.
|
java.lang.Object |
evaluateEcore(java.lang.Object ecoreObject)
Evaluates the query on the ecoreObject to return an ecoreResult using Integer/Double for numerics.
|
java.lang.Object |
evaluateUnboxed(java.lang.Object unboxedObject)
Evaluates the query on the unboxedObject to return an unboxedResult.
|
EvaluationEnvironment |
getEvaluationEnvironment(java.lang.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. |
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> |
rejectEcore(java.lang.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> java.util.List<T> |
selectEcore(java.lang.Iterable<T> ecoreObjects)
Determines the subset of ecoreObjects that satisfy the query.
|
java.lang.String |
toString() |
public QueryImpl(@NonNull OCL ocl, @NonNull ExpressionInOCL query)
public boolean checkBoxed(@Nullable java.lang.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(@NonNull java.lang.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(@Nullable java.lang.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(@NonNull java.lang.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
, otherwise@Nullable public java.lang.Object evaluateBoxed(@Nullable java.lang.Object boxedValue)
Query
evaluateBoxed
in interface Query
@NonNull public java.util.List<?> evaluateBoxed(@NonNull java.lang.Iterable<?> boxedObjects)
Query
evaluateBoxed
in interface Query
@Nullable public java.lang.Object evaluateEcore(@Nullable java.lang.Object ecoreObject) throws EvaluationException
Query
evaluateEcore
in interface Query
EvaluationException
@Nullable public java.lang.Object evaluateEcore(@Nullable java.lang.Class<?> instanceClass, @Nullable java.lang.Object ecoreObject) throws EvaluationException
Query
evaluateEcore
in interface Query
EvaluationException
@NonNull public org.eclipse.emf.common.util.EList<?> evaluateEcore(@NonNull java.lang.Iterable<?> ecoreObjects) throws EvaluationException
Query
evaluateEcore
in interface Query
EvaluationException
@NonNull public org.eclipse.emf.common.util.EList<?> evaluateEcore(@Nullable java.lang.Class<?> instanceClass, @NonNull java.lang.Iterable<?> ecoreObjects)
Query
evaluateEcore
in interface Query
@Nullable public java.lang.Object evaluateUnboxed(@Nullable java.lang.Object unboxedObject) throws EvaluationException
Query
evaluateUnboxed
in interface Query
EvaluationException
@NonNull public EvaluationEnvironment getEvaluationEnvironment(@Nullable java.lang.Object unboxedObject)
Query
getEvaluationEnvironment
in interface Query
@NonNull public OCLExpression getExpression()
Query
getExpression
in interface Query
@NonNull public OCL getOCL()
Query
Obtains the OCL
that created me.
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 queryText()
Query
@NonNull public <T> java.util.List<T> rejectEcore(@NonNull java.lang.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
@NonNull public <T> java.util.List<T> selectEcore(@NonNull java.lang.Iterable<T> ecoreObjects)
Query
selectEcore
in interface Query
ecoreObjects
- a list of objects to evaluate the constraint onobjects
that
satisfy the constraintpublic java.lang.String toString()
toString
in class java.lang.Object