|
||||||||||
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 static java.util.Hashtable |
nsTable
Map namepsace names (and nick-names) to Namespaces. |
protected java.lang.String |
prefix
|
protected gnu.mapping.SymbolRef[] |
table
|
Constructor Summary | |
---|---|
Namespace()
|
|
Namespace(int capacity)
|
Method Summary | |
---|---|
Symbol |
add(Symbol sym,
int hash)
|
java.lang.Object |
get(java.lang.String key)
|
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. |
boolean |
isConstant(java.lang.String key)
|
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)
|
static Namespace |
make(java.lang.String name)
|
static Namespace |
make(java.lang.String uri,
java.lang.String prefix)
|
static Namespace |
makeUnknownNamespace(java.lang.String prefix)
Create a "placeholder" for a namespace with a known prefix but unknown uri. |
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 |
---|
protected static final java.util.Hashtable nsTable
public static final Namespace EmptyNamespace
protected java.lang.String prefix
protected gnu.mapping.SymbolRef[] table
Constructor Detail |
---|
public Namespace()
public Namespace(int capacity)
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 make(java.lang.String name)
public static Namespace getInstance(java.lang.String name)
public static Namespace make(java.lang.String uri, java.lang.String prefix)
public static Namespace makeUnknownNamespace(java.lang.String prefix)
Symbol.makeWithUnknownNamespace(java.lang.String, java.lang.String)
public java.lang.Object get(java.lang.String key)
get
in interface HasNamedParts
public boolean isConstant(java.lang.String key)
isConstant
in interface HasNamedParts
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 |