net.christopherschultz.evaluator
Interface EvaluationContext

All Known Implementing Classes:
ChainedEvaluationContext, DefaultEvaluationContext

public interface EvaluationContext

Contains important information about the current expression evaluation.

The EvaluationContext stores all of the functions and constants that are bound and can be referenced by any expression. Everything is a first-class object in the evaluation context including functions, variables, etc. To bind an identifier to a value, see the set(java.lang.String, java.lang.Object) method. To get the value of an identifier, see the get(java.lang.String) method.

Version:
$Revision: 1.10 $ $Date: 2008-06-20 22:58:48 $
Author:
Chris Schultz

Method Summary
 Object get(String identifier)
          Gets the value of the specified identifier.
 Map getAll()
          Returns a Map of all bound identifiers and their values.
 Object getProperty(String key)
          Gets the specified property.
 Object remove(String identifier)
          Removes the value of an identifier.
 void removeProperty(Object key)
          Removes the specified property.
 Object set(String identifier, Object value)
          Sets the value of an identifer.
 void setProperty(String key, Object value)
          Sets the specified property to the given value.
 

Method Detail

get

Object get(String identifier)
Gets the value of the specified identifier.

Parameters:
identifier - The identifier for the value.
Returns:
The value of the specified identifier.

getAll

Map getAll()
Returns a Map of all bound identifiers and their values. The Map is not modifiable.

Returns:
A Map of all identifiers as keys and their values as the values of the Map.

set

Object set(String identifier,
           Object value)
Sets the value of an identifer.

Parameters:
identifier - The identifier for the value.
value - The value for the identifier.
Returns:
The value object.

remove

Object remove(String identifier)
Removes the value of an identifier.

Parameters:
identifier - The identifier whose value should be removed.
Returns:
The old value of the object, or null if there was no value.

setProperty

void setProperty(String key,
                 Object value)
Sets the specified property to the given value.

Parameters:
key - The name of the property.
value - The value of the property.

getProperty

Object getProperty(String key)
Gets the specified property.

Parameters:
key - The name of the property.
Returns:
The value of the specified property.

removeProperty

void removeProperty(Object key)
Removes the specified property.

Parameters:
key - The name of the property to remove.