|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.mapping.Namespace
public class Namespace
A mapping from strings ("print names") to Symbol
s.
Namespaces are normally named and can be accessed from a global table.
They correspond to Common Lisp "packages" (which are implemented
using gnu.kawa.lispexpr.LispPackage
,
which extends Namespace
).
A Namespace
is a "weak" mapping in the sense that a
Symbol
can be garbage collected even though it is
referenced from a Namespace
.
Field Summary | |
---|---|
static Namespace |
EmptyNamespace
The Namespace with the empty name. |
protected gnu.mapping.SymbolRef[] |
table
|
Constructor Summary | |
---|---|
|
Namespace()
|
|
Namespace(int capacity)
|
protected |
Namespace(java.lang.String name,
int dummy)
A kludge used for serializing SName. |
Method Summary | |
---|---|
Symbol |
add(Symbol sym,
int hash)
|
static Namespace |
getDefault()
|
static Symbol |
getDefaultSymbol(java.lang.String name)
|
static Namespace |
getInstance(java.lang.String name)
|
java.lang.String |
getName()
Get the name of this Namespace. |
Symbol |
getSymbol(java.lang.String key)
Get a Symbol matching the given name. |
Symbol |
lookup(java.lang.String key)
Get a Symbol matching the given name. |
Symbol |
lookup(java.lang.String key,
int hash,
boolean create)
|
protected Symbol |
lookupInternal(java.lang.String key,
int hash)
|
void |
readExternal(java.io.ObjectInput in)
|
java.lang.Object |
readResolve()
|
protected void |
rehash()
|
boolean |
remove(Symbol symbol)
|
void |
setName(java.lang.String name)
Set the name of this Namespace. |
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Namespace EmptyNamespace
protected gnu.mapping.SymbolRef[] table
Constructor Detail |
---|
public Namespace()
public Namespace(int capacity)
protected Namespace(java.lang.String name, int dummy)
Method Detail |
---|
public final java.lang.String getName()
public final void setName(java.lang.String name)
public static Namespace getDefault()
public static Symbol getDefaultSymbol(java.lang.String name)
public static Namespace getInstance(java.lang.String name)
public Symbol getSymbol(java.lang.String key)
public Symbol lookup(java.lang.String key)
protected final Symbol lookupInternal(java.lang.String key, int hash)
public Symbol add(Symbol sym, int hash)
public Symbol lookup(java.lang.String key, int hash, boolean create)
public boolean remove(Symbol symbol)
protected void rehash()
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
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |