|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.common.notify.impl.BasicNotifierImpl
org.eclipse.emf.ecore.impl.BasicEObjectImpl
org.eclipse.emf.ecore.impl.EObjectImpl
org.eclipse.emf.ocl.query.impl.QueryImpl
public class QueryImpl
An implementation of the model object 'Query'.
The following features are implemented:
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl |
---|
BasicEObjectImpl.EPropertiesHolder, BasicEObjectImpl.EPropertiesHolderBaseImpl, BasicEObjectImpl.EPropertiesHolderImpl |
Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl |
---|
BasicNotifierImpl.EAdapterList<E extends Object & Adapter> |
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.InternalEObject |
---|
InternalEObject.EStore |
Field Summary | |
---|---|
static String |
copyright
|
protected OCLExpression |
expression
The cached value of the ' Expression ' reference |
protected static Map |
EXTENT_MAP_EDEFAULT
The default value of the ' Extent Map ' attribute |
protected Map |
extentMap
The cached value of the ' Extent Map ' attribute |
Fields inherited from class org.eclipse.emf.ecore.impl.EObjectImpl |
---|
eAdapters, eContainer, eContainerFeatureID, EDELIVER, EDYNAMIC_CLASS, eFlags, ELAST_EOBJECT_FLAG, ELAST_NOTIFIER_FLAG, eProperties, EPROXY |
Fields inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl |
---|
EVIRTUAL_GET, EVIRTUAL_IS_SET, EVIRTUAL_NO_VALUE, EVIRTUAL_SET, EVIRTUAL_UNSET |
Fields inherited from interface org.eclipse.emf.ecore.InternalEObject |
---|
EOPPOSITE_FEATURE_BASE |
Constructor Summary | |
---|---|
protected |
QueryImpl()
|
protected |
QueryImpl(OCLExpression expr)
Creates a query from an OCLExpression (constraint or query). |
protected |
QueryImpl(String qs)
Parses and validates the query according to the well-formedness rules. |
Method Summary | |
---|---|
OCLExpression |
basicGetExpression()
|
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 |
eGet(int featureID,
boolean resolve,
boolean coreType)
|
boolean |
eIsSet(int featureID)
|
void |
eSet(int featureID,
Object newValue)
|
protected EClass |
eStaticClass()
|
void |
eUnset(int featureID)
|
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 |
getEvaluationEnvironment()
Obtains the evaluation environment that I use to evaluate OCL expressions. |
OCLExpression |
getExpression()
|
Map |
getExtentMap()
|
String |
queryText()
Translates the query back to an OCL text string. |
List |
reject(List objList)
Determines the subset of input objects that do not satisfy the query. |
EClassifier |
resultType()
Obtains the OCL result type of the query. |
List |
select(List objList)
Determines the subset of input objects that satisfy the query. |
void |
setEvaluationEnvironment(EvaluationEnvironment env)
Sets the evaluation environment that I use to evaluate OCL expressions. |
void |
setExtentMap(Map newExtentMap)
|
String |
toString()
|
protected void |
validate()
Validates me according to the rules for OCL well-formedness. |
Methods inherited from class org.eclipse.emf.ecore.impl.EObjectImpl |
---|
eAdapters, eBasicAdapters, eBasicProperties, eBasicSetContainer, eClass, eContainerFeatureID, eDeliver, eInternalContainer, eIsProxy, eProperties, eSetClass, eSetDeliver, eSetProxyURI |
Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl |
---|
eNotificationRequired, eNotify |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.emf.ecore.EObject |
---|
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eIsProxy, eIsSet, eResource, eSet, eUnset |
Methods inherited from interface org.eclipse.emf.common.notify.Notifier |
---|
eAdapters, eDeliver, eNotify, eSetDeliver |
Methods inherited from interface org.eclipse.emf.ecore.InternalEObject |
---|
eNotificationRequired |
Field Detail |
---|
public static final String copyright
protected static final Map EXTENT_MAP_EDEFAULT
Extent Map
' attribute.
getExtentMap()
protected Map extentMap
Extent Map
' attribute.
getExtentMap()
protected OCLExpression expression
Expression
' reference.
getExpression()
Constructor Detail |
---|
protected QueryImpl()
protected QueryImpl(String qs) throws ParserException
qs
- the query string
ParserException
- in case of a parser errorprotected QueryImpl(OCLExpression expr) throws SemanticException
OCLExpression
(constraint or query).
The query is validated according to OCL well-formedness rules.
expr
- the ocl expression
SemanticException
- in case of well-formedness problemsMethod Detail |
---|
protected EClass eStaticClass()
eStaticClass
in class EObjectImpl
public Map getExtentMap()
getExtentMap
in interface Query
EClassifier
) to their extents
(List
)Query.setExtentMap(Map)
public void setExtentMap(Map newExtentMap)
setExtentMap
in interface Query
newExtentMap
- a map of classifiers (EClassifier
) to their
extents (List
)Query.getExtentMap()
public OCLExpression getExpression()
getExpression
in interface Query
QueryPackage.getQuery_Expression()
public OCLExpression basicGetExpression()
public Object evaluate(Object obj)
Query
evaluate
in interface Query
obj
- an Object
EObject
s, 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()
Query
allInstances()
exclusively for evaluation.
evaluate
in interface Query
EObject
s, 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)
Query
check
in interface Query
obj
- an Object
or null
if the query
does not require an OCL 'self' context
true
or false
according to
whether the constraint is metQuery.check(List)
public List evaluate(List objList)
Query
evaluate
in interface Query
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 typeQuery.evaluate(Object)
,
Query.resultType()
public boolean check(List objList)
Query
check
in interface Query
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
, otherwiseQuery.check(Object)
public List select(List objList)
Query
select
in interface Query
objList
- a list of objects to evaluate the constraint on
objects
that
satisfy the constraintpublic List reject(List objList)
Query
reject
in interface Query
objList
- a list of objects to evaluate the constraint on
objects
that
do not satisfy the constraintpublic EClassifier resultType()
Query
EClassifier
in the user metamodel, or it may represent a core
Java language type (such as Boolean
in the case of constraints)
or an OCL data type.
resultType
in interface Query
public String queryText()
Query
queryText
in interface Query
public Object eGet(int featureID, boolean resolve, boolean coreType)
eGet
in interface InternalEObject
eGet
in class BasicEObjectImpl
public void eSet(int featureID, Object newValue)
eSet
in interface InternalEObject
eSet
in class BasicEObjectImpl
public void eUnset(int featureID)
eUnset
in interface InternalEObject
eUnset
in class BasicEObjectImpl
public boolean eIsSet(int featureID)
eIsSet
in interface InternalEObject
eIsSet
in class BasicEObjectImpl
protected void validate()
public void setEvaluationEnvironment(EvaluationEnvironment env)
Query
setEvaluationEnvironment
in interface Query
env
- my environmentpublic EvaluationEnvironment getEvaluationEnvironment()
Query
getEvaluationEnvironment
in interface Query
public String toString()
toString
in class BasicEObjectImpl
|
Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |