|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.mapping.Procedure gnu.mapping.Procedure1 gnu.mapping.NameMap gnu.mapping.Environment
public abstract class Environment
A mapping from EnvironmentKey
to Location
s.
An EnvironmentKey
is either a Symbol
or
a (Symbol
, property)-pair.
Field Summary | |
---|---|
static int |
INDIRECT_DEFINES
Newly defined locations are created in inherited parent environment. |
Constructor Summary | |
---|---|
Environment()
|
Method Summary | |
---|---|
void |
addLocation(EnvironmentKey key,
Location loc)
|
void |
addLocation(NamedLocation loc)
|
abstract NamedLocation |
addLocation(Symbol name,
java.lang.Object prop,
Location loc)
|
boolean |
containsKey(java.lang.Object key)
|
static Environment |
current()
Deprecated. |
Namespace |
defaultNamespace()
|
abstract void |
define(Symbol key,
java.lang.Object property,
java.lang.Object newValue)
|
abstract LocationEnumeration |
enumerateAllLocations()
Does enumerate inherited Locations. |
abstract LocationEnumeration |
enumerateLocations()
Does not enumerate inherited Locations. |
java.lang.Object |
get(EnvironmentKey key,
java.lang.Object defaultValue)
|
java.lang.Object |
get(java.lang.Object key)
Get the value bound to the given name. |
java.lang.Object |
get(java.lang.String key,
java.lang.Object defaultValue)
|
java.lang.Object |
get(Symbol sym)
|
java.lang.Object |
get(Symbol key,
java.lang.Object property,
java.lang.Object defaultValue)
|
boolean |
getCanDefine()
True if new bindings (non-unbound Locations) can be added. |
boolean |
getCanRedefine()
True if bindings can be removed or replaced by other kinds of Location. |
static Environment |
getCurrent()
|
int |
getFlags()
|
java.lang.Object |
getFunction(Symbol sym)
|
java.lang.Object |
getFunction(Symbol key,
java.lang.Object defaultValue)
|
static Environment |
getGlobal()
|
static Environment |
getInstance(java.lang.String name)
|
Location |
getLocation(java.lang.Object key,
boolean create)
|
Location |
getLocation(Symbol key)
Return a location bound to key (and null property). |
Location |
getLocation(Symbol key,
java.lang.Object property)
Return a location bound to (key, property). |
NamedLocation |
getLocation(Symbol name,
java.lang.Object property,
boolean create)
|
abstract NamedLocation |
getLocation(Symbol key,
java.lang.Object property,
int hash,
boolean create)
|
Symbol |
getSymbol(java.lang.String name)
|
protected abstract boolean |
hasMoreElements(LocationEnumeration it)
|
boolean |
isBound(Symbol key)
|
boolean |
isBound(Symbol key,
java.lang.Object property)
|
boolean |
isLocked()
True if this environment is locked - bindings cannot be added or removed. |
Location |
lookup(Symbol key)
|
Location |
lookup(Symbol key,
java.lang.Object property)
Return a location bound to (key, property). |
abstract NamedLocation |
lookup(Symbol name,
java.lang.Object property,
int hash)
|
static SimpleEnvironment |
make()
|
static SimpleEnvironment |
make(java.lang.String name)
|
static InheritingEnvironment |
make(java.lang.String name,
Environment parent)
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object newValue)
|
java.lang.Object |
put(java.lang.String key,
java.lang.Object value)
|
void |
put(Symbol key,
java.lang.Object newValue)
|
void |
put(Symbol key,
java.lang.Object property,
java.lang.Object newValue)
|
void |
putFunction(Symbol key,
java.lang.Object newValue)
|
java.lang.Object |
remove(EnvironmentKey key)
Remove and undefine binding. |
java.lang.Object |
remove(java.lang.Object key)
|
void |
remove(Symbol sym)
|
void |
remove(Symbol symbol,
java.lang.Object property)
|
void |
remove(Symbol key,
java.lang.Object property,
int hash)
Remove Location from this Environment and undefined it. |
void |
removeFunction(Symbol sym)
|
void |
setCanDefine(boolean canDefine)
|
void |
setCanRedefine(boolean canRedefine)
|
static void |
setCurrent(Environment env)
|
void |
setFlag(boolean setting,
int flag)
|
static void |
setGlobal(Environment env)
|
void |
setIndirectDefines()
|
void |
setLocked()
|
java.lang.String |
toString()
|
java.lang.String |
toStringVerbose()
Overridden in sub-classes - useful for more verbose debug output. |
Location |
unlink(Symbol key,
java.lang.Object property,
int hash)
Remove Location from this Environment. |
static Environment |
user()
|
Methods inherited from class gnu.mapping.NameMap |
---|
apply1, getChecked, set1 |
Methods inherited from class gnu.mapping.Procedure1 |
---|
apply0, apply2, apply3, apply4, applyN, numArgs |
Methods inherited from class gnu.mapping.Procedure |
---|
apply, apply, check0, check1, check2, check3, check4, checkArgCount, checkN, getName, getProperty, getSetter, getSymbol, match0, match1, match2, match3, match4, matchN, maxArgs, minArgs, name, removeProperty, set0, setN, setName, setProperty, setProperty, setSetter, setSymbol |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface gnu.mapping.HasSetter |
---|
getSetter |
Field Detail |
---|
public static final int INDIRECT_DEFINES
Constructor Detail |
---|
public Environment()
Method Detail |
---|
public static void setGlobal(Environment env)
public static Environment getGlobal()
public int getFlags()
public void setFlag(boolean setting, int flag)
public boolean getCanDefine()
public void setCanDefine(boolean canDefine)
public boolean getCanRedefine()
public void setCanRedefine(boolean canRedefine)
public final boolean isLocked()
public void setLocked()
public final void setIndirectDefines()
public final Location getLocation(Symbol key, java.lang.Object property)
public final Location getLocation(Symbol key)
public final Location lookup(Symbol key, java.lang.Object property)
public abstract NamedLocation lookup(Symbol name, java.lang.Object property, int hash)
public final Location lookup(Symbol key)
public abstract NamedLocation getLocation(Symbol key, java.lang.Object property, int hash, boolean create)
public final NamedLocation getLocation(Symbol name, java.lang.Object property, boolean create)
public final Location getLocation(java.lang.Object key, boolean create)
public boolean isBound(Symbol key, java.lang.Object property)
public final boolean isBound(Symbol key)
public final boolean containsKey(java.lang.Object key)
public java.lang.Object get(Symbol key, java.lang.Object property, java.lang.Object defaultValue)
public final java.lang.Object get(EnvironmentKey key, java.lang.Object defaultValue)
public final java.lang.Object get(java.lang.String key, java.lang.Object defaultValue)
get
in class NameMap
public java.lang.Object get(Symbol sym)
public final java.lang.Object getFunction(Symbol key, java.lang.Object defaultValue)
public final java.lang.Object getFunction(Symbol sym)
public final java.lang.Object get(java.lang.Object key)
NameMap
get
in class NameMap
NameMap.getChecked(String)
public void put(Symbol key, java.lang.Object property, java.lang.Object newValue)
public abstract void define(Symbol key, java.lang.Object property, java.lang.Object newValue)
public final void put(Symbol key, java.lang.Object newValue)
public final java.lang.Object put(java.lang.Object key, java.lang.Object newValue)
public final void putFunction(Symbol key, java.lang.Object newValue)
public final java.lang.Object put(java.lang.String key, java.lang.Object value)
put
in class NameMap
public Location unlink(Symbol key, java.lang.Object property, int hash)
public void remove(Symbol key, java.lang.Object property, int hash)
public java.lang.Object remove(EnvironmentKey key)
public void remove(Symbol symbol, java.lang.Object property)
public final void remove(Symbol sym)
public final void removeFunction(Symbol sym)
public final java.lang.Object remove(java.lang.Object key)
public Namespace defaultNamespace()
public Symbol getSymbol(java.lang.String name)
public static Environment getInstance(java.lang.String name)
public abstract LocationEnumeration enumerateLocations()
public abstract LocationEnumeration enumerateAllLocations()
protected abstract boolean hasMoreElements(LocationEnumeration it)
public static Environment current()
public static Environment getCurrent()
public static void setCurrent(Environment env)
public static Environment user()
public final void addLocation(NamedLocation loc)
public abstract NamedLocation addLocation(Symbol name, java.lang.Object prop, Location loc)
public final void addLocation(EnvironmentKey key, Location loc)
public static SimpleEnvironment make()
public static SimpleEnvironment make(java.lang.String name)
public static InheritingEnvironment make(java.lang.String name, Environment parent)
public java.lang.String toString()
toString
in class Procedure
public java.lang.String toStringVerbose()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |