## org.eclipse.emf.ocl.parser
Interface EvaluationEnvironment

All Known Implementing Classes:
  EvalEnvironment

Deprecated. Use the `EvaluationEnvironment` interface, instead.

    @Deprecated
    public interface EvaluationEnvironment

The evaluation environment keeps track of the current values of variables in the evaluation of an OCL expression.

Method Summary
`void` `add(String name, Object value)` Deprecated. Adds the supplied name and value binding to the environment.
`boolean` `canEvaluate(EOperation operation, int opcode)` Deprecated. Queries whether this evaluation environment provides a custom implementation of the specified OCL `operation`.
`void` `clear()` Deprecated. Clears the environment of variables.
`Object` `evaluate(EOperation operation, int opcode, Object target, Object[] args)` Deprecated. Evaluates the specified `operation` on a given `target` object with arguments.
`Object` `getValueOf(String name)` Deprecated. Returns the value associated with the supplied name
`Object` `remove(String name)` Deprecated. Removes the supplied name and binding from the environment (if it exists) and returns it.
`void` `replace(String name, Object value)` Deprecated. Replaces the current value of the supplied name with the supplied value.

Method Detail

### getValueOf

    Object getValueOf(String name)

  Deprecated.
  Returns the value associated with the supplied name

  Parameters:
    `name` - the name whose value is to be returned
  Returns:
    the value associated with the name

### replace

    void replace(String name,
                 Object value)

  Deprecated.
  Replaces the current value of the supplied name with the supplied value.

  Parameters:
    `name` - the name
    `value` - the new value

### add

    void add(String name,
             Object value)

  Deprecated.
  Adds the supplied name and value binding to the environment. The name must not already be bound.

  Parameters:
    `name` - the name to add
    `value` - the associated binding
  See Also:
    `replace(String, Object)`

### remove

    Object remove(String name)

  Deprecated.
  Removes the supplied name and binding from the environment (if it exists) and returns it.

  Parameters:
    `name` - the name to remove
  Returns:
    the value associated with the removed name

### clear

    void clear()

  Deprecated.
  Clears the environment of variables.

### canEvaluate

    boolean canEvaluate(EOperation operation,
                        int opcode)

  Deprecated.
  Queries whether this evaluation environment provides a custom implementation of the specified OCL `operation`. In the case that the receiver does, then it must implement the `evaluate(EOperation, int, Object, Object[])` method to apply the operation.

  Parameters:
    `operation` - an OCL operation
    `opcode` - the operation code, if one of the operations pre-defined by OCL. Otherwise, `-1`
  Returns:
    `true` if this evaluation environment provides an implementation of this `operation`; `false`, otherwise
  See Also:
    `evaluate(EOperation, int, Object, Object[])`

### evaluate

    Object evaluate(EOperation operation,
                    int opcode,
                    Object target,
                    Object[] args)
                    throws UnsupportedOperationException

  Deprecated.
  Evaluates the specified `operation` on a given `target` object with arguments.

  Parameters:
    `operation` - the operation to evaluate
    `opcode` - 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` type
    `args` - the arguments passed to the `operation`. Will be an empty array if there are none (not `null`)
  Returns:
    the value of the operation, or `null` if the operation has no return result
  Throws:
    `UnsupportedOperationException` - if the specified `operation` is not implemented by this environment
  See Also:
    `canEvaluate(EOperation, int)`

Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved.