gnu.mapping
public class Namespace extends Object implements Externalizable, HasNamedParts
Symbols.
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 Hashtable | nsTable Map namepsace names (and nick-names) to Namespaces. |
| protected String | prefix |
| protected SymbolRef[] | table |
| Constructor Summary | |
|---|---|
| Namespace() | |
| Namespace(int capacity) | |
| Method Summary | |
|---|---|
| Symbol | add(Symbol sym, int hash) |
| Object | get(String key) |
| static Namespace | getDefault() |
| static Symbol | getDefaultSymbol(String name) |
| static Namespace | getInstance(String name) |
| String | getName() Get the name of this Namespace. |
| Symbol | getSymbol(String key) Get a Symbol matching the given name.
|
| boolean | isConstant(String key) |
| Symbol | lookup(String key) Get a Symbol matching the given name.
|
| Symbol | lookup(String key, int hash, boolean create) |
| protected Symbol | lookupInternal(String key, int hash) |
| static Namespace | make(String name) |
| static Namespace | make(String uri, String prefix) |
| static Namespace | makeUnknownNamespace(String prefix) Create a "placeholder" for a namespace with a known prefix
but unknown uri. |
| void | readExternal(ObjectInput in) |
| Object | readResolve() |
| protected void | rehash() |
| boolean | remove(Symbol symbol) |
| void | setName(String name) Set the name of this Namespace. |
| String | toString() |
| void | writeExternal(ObjectOutput out) |
See Also: Symbol