|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IEnvironment<T>
Interface for environments. See Environment for a practical
implementation. The generic type parameter is the type of the values stored
in the environment; the keys must be Symbols.
| Method Summary | |
|---|---|
void |
add(ISymbol variable,
T value)
Adds a new variable to the current environment. |
IEnvironment<T> |
create()
Creates a nested environment. |
void |
define(ISymbol variable,
T value)
Defines the variable in the top level environment. |
T |
get(ISymbol variable)
Returns the value associated with the specified variable. |
T |
set(ISymbol variable,
T value)
Changes the value associated with the specified variable. |
| Method Detail |
|---|
void define(ISymbol variable,
T value)
variable - the variable to define.value - the value to set it to.
void add(ISymbol variable,
T value)
throws InvalidVariableException
variable - the new variable to add to the environment.value - the new value to associate with the new variable.
InvalidVariableException - when the variable is already declared in the current
scope.
T get(ISymbol variable)
throws InvalidVariableException
variable - the variable to search for.
InvalidVariableException - when the variable is undeclared (in this or any previous
scope).
T set(ISymbol variable,
T value)
throws InvalidVariableException
variable - the variable to search for.value - the new value for the variable.
InvalidVariableException - when the variable is undeclared (in this or any previous
scope).IEnvironment<T> create()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||