lij.runtime
Class SymbolTable
java.lang.Object
lij.runtime.SymbolTable
public class SymbolTable
- extends java.lang.Object
A SymbolTable instance is used by objects of the ClauseInstance class, for
storing mappings between variable names and variable values.
- Author:
- Nikolaos Chatzinikolaou
Field Summary |
private java.util.HashMap<java.lang.String,java.io.Serializable> |
table
|
Method Summary |
java.io.Serializable |
get(ArgumentVariable variable)
Retrieves the value of the specified variable from the SymbolTable. |
void |
put(ArgumentVariable variable,
java.io.Serializable value)
Stores the specified variable and its associated value into the
SymbolTable. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
table
private java.util.HashMap<java.lang.String,java.io.Serializable> table
SymbolTable
public SymbolTable()
put
public void put(ArgumentVariable variable,
java.io.Serializable value)
- Stores the specified variable and its associated value into the
SymbolTable.
- Parameters:
variable
- The variable.value
- The value.
get
public java.io.Serializable get(ArgumentVariable variable)
- Retrieves the value of the specified variable from the SymbolTable. If a
variable with the specified name does not exist, it is created with a
null value.
- Parameters:
variable
- The variable.
- Returns:
- The value associated with the variable.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object