|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The evaluation environment keeps track of the current values of variables in the evaluation of an OCL expression.
Method Summary | |
---|---|
void |
add(java.lang.String name,
java.lang.Object value)
Adds the supplied name and value binding to the environment. |
boolean |
canEvaluate(org.eclipse.emf.ecore.EOperation operation,
int opcode)
Queries whether this evaluation environment provides a custom implementation of the specified OCL operation . |
void |
clear()
Clears the environment of variables. |
java.lang.Object |
evaluate(org.eclipse.emf.ecore.EOperation operation,
int opcode,
java.lang.Object target,
java.lang.Object[] args)
Evaluates the specified operation on a given
target object with arguments. |
java.lang.Object |
getValueOf(java.lang.String name)
Returns the value associated with the supplied name |
java.lang.Object |
remove(java.lang.String name)
Removes the supplied name and binding from the environment (if it exists) and returns it. |
void |
replace(java.lang.String name,
java.lang.Object value)
Replaces the current value of the supplied name with the supplied value. |
Method Detail |
public java.lang.Object getValueOf(java.lang.String name)
name
- the name whose value is to be returned
public void replace(java.lang.String name, java.lang.Object value)
name
- the namevalue
- the new valuepublic void add(java.lang.String name, java.lang.Object value)
name
- the name to addvalue
- the associated bindingEvaluationEnvironment.replace(String, Object)
public java.lang.Object remove(java.lang.String name)
name
- the name to remove
public void clear()
public boolean canEvaluate(org.eclipse.emf.ecore.EOperation operation, int opcode)
operation
. In the case
that the receiver does, then it must implement the
EvaluationEnvironment.evaluate(EOperation, int, Object, Object[])
method to apply
the operation.
operation
- an OCL operationopcode
- the operation code, if one of the operations pre-defined
by OCL. Otherwise, -1
true
if this evaluation environment provides an
implementation of this operation
; false
,
otherwiseEvaluationEnvironment.evaluate(EOperation, int, Object, Object[])
public java.lang.Object evaluate(org.eclipse.emf.ecore.EOperation operation, int opcode, java.lang.Object target, java.lang.Object[] args) throws java.lang.UnsupportedOperationException
operation
on a given
target
object with arguments.
operation
- the operation to evaluateopcode
- the operation code, if one of the operations pre-defined
by OCL. Otherwise, -1
target
- the object on which to apply the operation
.
the target may be an EObject
or it
may not, depending on the EClassifier
typeargs
- the arguments passed to the operation
. Will
be an empty array if there are none (not null
)
null
if the operation
has no return result
java.lang.UnsupportedOperationException
- if the specified
operation
is not implemented by this environmentEvaluationEnvironment.canEvaluate(EOperation, int)
|
Copyright 2002, 2006 IBM Corporation and others. All Rights Reserved. |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |