|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectpnuts.lang.Package
pnuts.ext.CompositePackage
public class CompositePackage
Composed hierarchical names space based on a Package. A read access first looks for the symbol in the local symbol table, if not found, then looks for the base package. A write access never affect the base package.
| Field Summary |
|---|
| Fields inherited from class pnuts.lang.Package |
|---|
autoloadTable, exportedSymbols, exports, globalPackage, initialized, name, packages, parent, providedModuleNames, requiredModuleNames, root, usedAsModule |
| Constructor Summary | |
|---|---|
CompositePackage()
|
|
CompositePackage(Package base)
Constructor |
|
| Method Summary | |
|---|---|
java.util.Enumeration |
bindings()
Returns an enumeration of the NamedValues in the symbol table. |
void |
clear()
Deletes all name-value bindings. |
java.lang.Object |
get(java.lang.String interned)
Gets the value of a variable. |
Package |
getBasePackage()
Gets the base package |
java.util.Enumeration |
keys()
Returns an enumeration of the keys in the symbol table. |
NamedValue |
lookup(java.lang.String symbol)
Looks for a name-value binding in the symbol table chain. |
NamedValue |
lookup(java.lang.String symbol,
Context context)
First looks for the symbol in the local symbol table. |
Package |
newInstance(java.lang.String name)
Creates a sub-package |
void |
set(java.lang.String interned,
java.lang.Object value)
Defines a name-value binding in the symbol table. |
void |
setConstant(java.lang.String interned,
java.lang.Object value)
Defines a constant in the symbol table. |
int |
size()
|
java.util.Enumeration |
values()
Returns an enumeration of the values in the symbol table. |
| Methods inherited from class pnuts.lang.Package |
|---|
addPackage, asMap, autoload, autoload, clear, clone, defined, elements, export, find, find, get, getGlobalPackage, getName, getPackage, getPackage, getParent, init, initializeModule, lookupRecursively, remove, remove, removePackage, set, toString, wrap |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CompositePackage()
public CompositePackage(Package base)
base - the base package| Method Detail |
|---|
public Package newInstance(java.lang.String name)
newInstance in class Packagename - the name of the sub-package
public Package getBasePackage()
public NamedValue lookup(java.lang.String symbol,
Context context)
lookup in class Packagesymbol - the symbol to look forcontext - the context
public NamedValue lookup(java.lang.String symbol)
symbol - the name of the variable, which must be intern'd
public java.lang.Object get(java.lang.String interned)
interned - the name of the variable, which must be intern'd
public void set(java.lang.String interned,
java.lang.Object value)
interned - the name of the variable, which must be intern'dvalue - the new value
java.lang.IllegalStateException - thrown when the specified symbol has been defined as a
constant.
public void setConstant(java.lang.String interned,
java.lang.Object value)
interned - the name of the variable, which must be intern'dvalue - the constant value
java.lang.IllegalStateException - thrown when the specified symbol has been defined as a
constantpublic void clear()
public int size()
public java.util.Enumeration bindings()
NamedValuepublic java.util.Enumeration keys()
public java.util.Enumeration values()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||