|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ix.util.lisp.Symbol
public class Symbol
The root class for Lisp symbols.
The correct way to create a new symbol is to call
intern(String name)
.
It will return an instance of Symbol or of an appropriate subclass,
typically depending on the first character of the name.
Field Summary | |
---|---|
protected java.lang.String |
name
This Symbol's name. |
protected static java.util.Hashtable |
obTable
The mapping from names to Symbols used to ensure that there is at most one symbol with any given name. |
Constructor Summary | |
---|---|
protected |
Symbol(java.lang.String name)
Constructs a Symbol with the specified name and records it as the Symbol that corresponds to that name. |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object o)
|
static boolean |
exists(java.lang.String name)
Returns true iff a symbol with the specified name exists. |
static Symbol |
intern(java.lang.String s)
Returns the Symbol that has the specified string as its name, creating a new one only if one does not already exist. |
(package private) static Symbol |
quickIntern(java.lang.String s)
A simple, faster version of intern(String) that
is used internally when it's known that the string does
not contain any characters that need escaping. |
protected java.lang.Object |
readResolve()
|
java.lang.String |
toString()
|
static Symbol |
valueOf(java.lang.String name)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static java.util.Hashtable obTable
protected java.lang.String name
Constructor Detail |
---|
protected Symbol(java.lang.String name)
intern(String)
whenever it
is given that name. This constructor should not normally
be called directly. Call intern(String)
instead.
Method Detail |
---|
public static Symbol intern(java.lang.String s)
Keyword
if the name begins with ":".
ItemVar
if the name begins with "?".
NumberlikeSymbol
if the name would normally
be parsed as an integer or floating-point number.
DelimitedSymbol
if the name would not normally
be parsed as a Symbol because it contains whitespace,
parentheses, or other syntactically significan characters.
Symbol
in all other cases.
static Symbol quickIntern(java.lang.String s)
intern(String)
that
is used internally when it's known that the string does
not contain any characters that need escaping.
public static boolean exists(java.lang.String name)
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
protected java.lang.Object readResolve() throws java.io.ObjectStreamException
java.io.ObjectStreamException
public java.lang.String toString()
toString
in class java.lang.Object
public static Symbol valueOf(java.lang.String name)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |