|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface implemented by any object which wishes to be able to store variable
values. This class may work in conjunction with Variable
to maintain a
single list of all the variable names and values.
The basic concept is that the implementing class keeps a list of variable names
and associated values and gives the user access to those values.
Method Summary | |
void |
add(java.lang.String name)
Add a variable with name name to the dereferencer. |
void |
assign(java.lang.String name,
int value)
Should allow the user to assign the value of value
to the variable of name. |
void |
demark()
Remove all variables added to the table since the last mark() |
int |
dereference(java.lang.String name)
The class implementing this should be able to return the value associated with name . |
boolean |
exists(java.lang.String s)
|
void |
mark()
Adds a mark to the table. |
Method Detail |
public int dereference(java.lang.String name)
name
.name
- variable to return the value ofpublic void assign(java.lang.String name, int value)
value
to the variable of name.
- Parameters:
name
- variable to assign tovalue
- value to be assigned to name
public void add(java.lang.String name)
name
to the dereferencer.
The implementer should be wary of having multiple variables with
the same name becasue of potential lost data.name
- variable to addpublic void mark()
public void demark()
mark()
public boolean exists(java.lang.String s)
s
- variable name to check for existences
is in the
dereferencer
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |