gnu.mapping
public abstract class Environment extends PropertySet
EnvironmentKey to Locations.
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. |
| Method Summary | |
|---|---|
| void | addLocation(NamedLocation loc) |
| abstract NamedLocation | addLocation(Symbol name, Object prop, Location loc) |
| void | addLocation(EnvironmentKey key, Location loc) |
| boolean | containsKey(Object key) |
| static Environment | current() |
| Namespace | defaultNamespace() |
| abstract void | define(Symbol key, Object property, Object newValue) |
| abstract LocationEnumeration | enumerateAllLocations() Does enumerate inherited Locations. |
| abstract LocationEnumeration | enumerateLocations() Does not enumerate inherited Locations. |
| Object | get(Symbol key, Object property, Object defaultValue) |
| Object | get(EnvironmentKey key, Object defaultValue) |
| Object | get(String key, Object defaultValue) |
| Object | get(Symbol sym) |
| Object | get(Object key) Get the value bound to the given name.
|
| 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. |
| Object | getChecked(String name) Get the value bound to the given name. |
| static Environment | getCurrent() |
| int | getFlags() |
| Object | getFunction(Symbol key, Object defaultValue) |
| Object | getFunction(Symbol sym) |
| static Environment | getGlobal() |
| static Environment | getInstance(String name) |
| Location | getLocation(Symbol key, Object property) Return a location bound to (key, property).
|
| Location | getLocation(Symbol key) Return a location bound to key (and null property).
|
| abstract NamedLocation | getLocation(Symbol key, Object property, int hash, boolean create) |
| NamedLocation | getLocation(Symbol name, Object property, boolean create) |
| Location | getLocation(Object key, boolean create) |
| Symbol | getSymbol(String name) |
| protected abstract boolean | hasMoreElements(LocationEnumeration it) |
| boolean | isBound(Symbol key, Object property) |
| boolean | isBound(Symbol key) |
| boolean | isLocked() True if this environment is locked - bindings cannot be added or removed. |
| Location | lookup(Symbol key, Object property) Return a location bound to (key, property).
|
| abstract NamedLocation | lookup(Symbol name, Object property, int hash) |
| Location | lookup(Symbol key) |
| static SimpleEnvironment | make() |
| static SimpleEnvironment | make(String name) |
| static InheritingEnvironment | make(String name, Environment parent) |
| void | put(Symbol key, Object property, Object newValue) |
| void | put(Symbol key, Object newValue) |
| Object | put(Object key, Object newValue) |
| Object | put(String key, Object value) |
| void | putFunction(Symbol key, Object newValue) |
| Object | remove(Symbol key, Object property, int hash) Remove Location from this Environment and undefine it. |
| Object | remove(EnvironmentKey key) Remove and undefine binding. |
| Object | remove(Symbol symbol, Object property) |
| void | remove(Symbol sym) |
| Object | remove(Object key) |
| 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() |
| String | toString() |
| String | toStringVerbose() Overridden in sub-classes - useful for more verbose debug output. |
| Location | unlink(Symbol key, Object property, int hash) Remove Location from this Environment.
|
| static Environment | user() |
Deprecated:
See Also: getChecked
Throws: gnu.mapping.UnboundLocationException the name has no binding
See Also: get
Returns: Old value