org.norecess.citkit
Class Symbol
java.lang.Object
org.norecess.citkit.Symbol
- All Implemented Interfaces:
- ISymbol
public class Symbol
- extends java.lang.Object
- implements ISymbol
Symbols are interned names for identifiers and other names in a program.
Reference equality is ensured.
Symbols are to be used in IEnvironment
s and SymbolTable
s.
- Author:
- Jeremy D. Frens
Method Summary |
static Symbol |
createSymbol(java.lang.String name)
Use this static method to create symbols instead of a constructor. |
java.lang.String |
getName()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getName
public java.lang.String getName()
- Specified by:
getName
in interface ISymbol
createSymbol
public static Symbol createSymbol(java.lang.String name)
- Use this static method to create symbols instead of a constructor. This
interns all symbol names so that symbol references are unique.
- Parameters:
name
- the name of the symbol.
- Returns:
- the unique reference to any symbol with this same name.