|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.mapping.Symbol
public class Symbol
A Symbol is a name, usually in a specific Namespace.
A Symbol is stateless: Comon Lisp-style "value", "function" and
"property list" bindings are not part of the Symbol itself, but
looked up in the current Environment.
A Symbol
may be viewed as an EnvironmentKey
with a null
property component.
Field Summary | |
---|---|
static java.lang.Object |
FUNCTION
Conventional value used as a property key for function bindings. |
protected java.lang.String |
name
|
static Symbol |
PLIST
Conventional value used as a Symbol name to
access an Object 's property list. |
Constructor Summary | |
---|---|
Symbol()
|
|
Symbol(java.lang.String name)
|
|
Symbol(java.lang.String name,
Namespace ns)
|
Method Summary | |
---|---|
int |
compareTo(java.lang.Object o)
|
boolean |
equals(java.lang.Object o)
Just tests for identity. |
java.lang.Object |
getKeyProperty()
|
Symbol |
getKeySymbol()
|
java.lang.String |
getLocalName()
Synonym for getName - the "print name" of the symbol without Namespace. |
java.lang.String |
getName()
|
Namespace |
getNamespace()
|
java.lang.String |
getNamespaceURI()
|
boolean |
hasEmptyNamespace()
|
int |
hashCode()
|
static Symbol |
make(java.lang.Object namespace,
java.lang.String name)
Find or create a symbol in a specificed environment. |
boolean |
matches(EnvironmentKey key)
|
boolean |
matches(Symbol symbol,
java.lang.Object property)
|
void |
print(java.io.PrintWriter ps)
|
void |
readExternal(java.io.ObjectInput in)
|
java.lang.Object |
readResolve()
|
void |
setNamespace(Namespace ns)
|
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String name
public static final java.lang.Object FUNCTION
public static final Symbol PLIST
Symbol
name to
access an Object
's property list.
A property list is a list with a even number of
Pair
s, containing alternating keys and values.
They are used in Common Lisp and Emacs Lisp.
Kawa (following XEmacs) allows arbitrary objects to have property lists,
thus the PLIST as used as the name and the object as the property.
(In the future we'll do somethingg clever so that get(SYMBOL, KEY)
as the same as getf(get(PLIST, SYMBOL), KEY) - but much faster.)
Constructor Detail |
---|
public Symbol()
public Symbol(java.lang.String name)
public Symbol(java.lang.String name, Namespace ns)
Method Detail |
---|
public final Symbol getKeySymbol()
getKeySymbol
in interface EnvironmentKey
public final java.lang.Object getKeyProperty()
getKeyProperty
in interface EnvironmentKey
public boolean matches(EnvironmentKey key)
matches
in interface EnvironmentKey
public boolean matches(Symbol symbol, java.lang.Object property)
matches
in interface EnvironmentKey
public final java.lang.String getNamespaceURI()
public final boolean hasEmptyNamespace()
public final java.lang.String getLocalName()
public final java.lang.String getName()
public static Symbol make(java.lang.Object namespace, java.lang.String name)
namespace
- can be an Namespace, or a namespace/environment name
(resolved using Environment.getInstance), or null (in which case
an uninterned symbol is created).name
- The "local name" or "print name" of the desired symbol.public void print(java.io.PrintWriter ps)
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public final Namespace getNamespace()
public final void setNamespace(Namespace ns)
public java.lang.String toString()
toString
in class java.lang.Object
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public java.lang.Object readResolve() throws java.io.ObjectStreamException
java.io.ObjectStreamException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |