gnu.mapping
public class Symbol extends Object implements EnvironmentKey, Comparable, Externalizable
Symbol
may be viewed as an EnvironmentKey
with a null
property component.
Field Summary | |
---|---|
static Symbol | FUNCTION Conventional value used as a property key for function bindings. |
protected String | name |
static Symbol | PLIST Conventional value used as a Symbol name to
access an Object 's property list.
|
Constructor Summary | |
---|---|
Symbol() | |
Symbol(Namespace ns, String name) Create new Symbol in a given namespace.
|
Method Summary | |
---|---|
int | compareTo(Object o) |
static boolean | equals(Symbol sym1, Symbol sym2) |
boolean | equals(Object o) Just tests for identity.
|
Object | getKeyProperty() |
Symbol | getKeySymbol() |
String | getLocalName() Synonym for getName - the "print name" of the symbol without Namespace.
|
String | getLocalPart() |
String | getName() |
Namespace | getNamespace() |
String | getNamespaceURI() |
String | getPrefix() |
boolean | hasEmptyNamespace() |
int | hashCode() |
static Symbol | make(String uri, String name, String prefix) Find or create a symbol in a specificed namespace. |
static Symbol | make(Object namespace, String name) Find or create a symbol in a specificed namespace. |
static Symbol | makeUninterned(String name) |
static Symbol | makeWithUnknownNamespace(String local, String prefix) Make a placeholder symbol with a known prefix and unknown namespace-uri.
|
boolean | matches(EnvironmentKey key) |
boolean | matches(Symbol symbol, Object property) |
static Symbol | parse(String symbol) Parse a String as a Symbol.
|
void | readExternal(ObjectInput in) |
Object | readResolve() |
void | setNamespace(Namespace ns) |
String | toString() |
void | writeExternal(ObjectOutput out) |
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.)Parameters: name an interned String
Parameters: uri a namespace uri. name The "local name" or "print name" of the desired symbol. prefix namespace prefix, or {@code ""}
Parameters: namespace can be an Namespace, or a namespace/environment name (resolved using Namespace.getInstance), or null (in which case an uninterned symbol is created). name The "local name" or "print name" of the desired symbol.