Interface Nametable
-
- All Known Implementing Classes:
NametableStack.LocalNametable
,SimpleNametable
public interface Nametable
A name table interface- Author:
- TiongHiang Lee (thlee@onemindsoft.org)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object
access(java.lang.String name)
Access the value associated with namejava.util.Map
asMap()
Return map representation of this nametablejava.lang.Object
assign(java.lang.String name, java.lang.Object value)
Assign a variable in the name tableboolean
containsName(java.lang.String name)
Whether the nametable contains the namevoid
declare(java.lang.String name, java.lang.Object value)
Declare a variable in the name tablevoid
undeclare(java.lang.String name)
Undeclare the name
-
-
-
Method Detail
-
declare
void declare(java.lang.String name, java.lang.Object value)
Declare a variable in the name table- Parameters:
name
- the namevalue
- the value
-
assign
java.lang.Object assign(java.lang.String name, java.lang.Object value)
Assign a variable in the name table- Parameters:
name
- the namevalue
- the value- Returns:
- the old value, or null
-
containsName
boolean containsName(java.lang.String name)
Whether the nametable contains the name- Parameters:
name
- the name- Returns:
- true if contains the name
-
access
java.lang.Object access(java.lang.String name)
Access the value associated with name- Parameters:
name
-- Returns:
-
undeclare
void undeclare(java.lang.String name)
Undeclare the name- Parameters:
name
-
-
asMap
java.util.Map asMap()
Return map representation of this nametable- Returns:
- unmodifiable map representation of this nametable
-
-