Package gnu.mapping
Class SimpleEnvironment
- java.lang.Object
-
- gnu.mapping.PropertySet
-
- gnu.mapping.Environment
-
- gnu.mapping.SimpleEnvironment
-
- All Implemented Interfaces:
Named
- Direct Known Subclasses:
InheritingEnvironment
public class SimpleEnvironment extends Environment
Concrete implementation ofEnvironment
. (Should consider merging this code with Table2D.)
-
-
Field Summary
-
Fields inherited from class gnu.mapping.Environment
curEnvironment, INDIRECT_DEFINES
-
Fields inherited from class gnu.mapping.PropertySet
nameKey
-
-
Constructor Summary
Constructors Constructor Description SimpleEnvironment()
SimpleEnvironment(int capacity)
SimpleEnvironment(String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NamedLocation
addLocation(Symbol name, Object property, Location loc)
protected NamedLocation
addUnboundLocation(Symbol name, Object property, int hash)
NamedLocation
define(Symbol sym, Object property, int hash, Object newValue)
void
define(Symbol sym, Object property, Object newValue)
Set
entrySet()
LocationEnumeration
enumerateAllLocations()
Does enumerate inherited Locations.LocationEnumeration
enumerateLocations()
Does not enumerate inherited Locations.static Location
getCurrentLocation(String name)
NamedLocation
getLocation(Symbol name, Object property, int hash, boolean create)
protected boolean
hasMoreElements(LocationEnumeration it)
NamedLocation
lookup(Symbol name, Object property, int hash)
static Object
lookup_global(Symbol name)
NamedLocation
lookupDirect(Symbol name, Object property, int hash)
protected NamedLocation
newLocation(Symbol name, Object property)
void
put(Symbol key, Object property, Object newValue)
void
readExternal(ObjectInput in)
Object
readResolve()
protected void
redefineError(Symbol name, Object property, Location loc)
int
size()
Size does not include inherited Locations.protected void
toStringBase(StringBuffer sbuf)
String
toStringVerbose()
Overridden in sub-classes - useful for more verbose debug output.Location
unlink(Symbol symbol, Object property, int hash)
Remove Location from this Environment.void
writeExternal(ObjectOutput out)
-
Methods inherited from class gnu.mapping.Environment
addLocation, addLocation, containsKey, current, defaultNamespace, get, get, get, get, get, getCanDefine, getCanRedefine, getChecked, getCurrent, getFlags, getFunction, getFunction, getGlobal, getInstance, getLocation, getLocation, getLocation, getLocation, getSymbol, isBound, isBound, isLocked, lookup, lookup, make, make, make, put, put, put, putFunction, remove, remove, remove, remove, remove, removeFunction, restoreCurrent, setCanDefine, setCanRedefine, setCurrent, setFlag, setGlobal, setIndirectDefines, setLocked, setSaveCurrent, toString, user
-
Methods inherited from class gnu.mapping.PropertySet
getName, getProperty, getSymbol, removeProperty, setName, setProperty, setProperty, setSymbol
-
-
-
-
Constructor Detail
-
SimpleEnvironment
public SimpleEnvironment()
-
SimpleEnvironment
public SimpleEnvironment(String name)
-
SimpleEnvironment
public SimpleEnvironment(int capacity)
-
-
Method Detail
-
size
public int size()
Size does not include inherited Locations.
-
lookup_global
public static Object lookup_global(Symbol name) throws UnboundLocationException
- Throws:
UnboundLocationException
-
lookup
public NamedLocation lookup(Symbol name, Object property, int hash)
- Specified by:
lookup
in classEnvironment
-
lookupDirect
public NamedLocation lookupDirect(Symbol name, Object property, int hash)
-
getLocation
public NamedLocation getLocation(Symbol name, Object property, int hash, boolean create)
- Specified by:
getLocation
in classEnvironment
-
addUnboundLocation
protected NamedLocation addUnboundLocation(Symbol name, Object property, int hash)
-
put
public void put(Symbol key, Object property, Object newValue)
- Overrides:
put
in classEnvironment
-
newLocation
protected NamedLocation newLocation(Symbol name, Object property)
-
define
public NamedLocation define(Symbol sym, Object property, int hash, Object newValue)
-
define
public void define(Symbol sym, Object property, Object newValue)
- Specified by:
define
in classEnvironment
-
addLocation
public NamedLocation addLocation(Symbol name, Object property, Location loc)
- Specified by:
addLocation
in classEnvironment
-
unlink
public Location unlink(Symbol symbol, Object property, int hash)
Description copied from class:Environment
Remove Location from this Environment. Does not explicitly undefine the location itself.- Overrides:
unlink
in classEnvironment
-
enumerateLocations
public LocationEnumeration enumerateLocations()
Does not enumerate inherited Locations.- Specified by:
enumerateLocations
in classEnvironment
-
enumerateAllLocations
public LocationEnumeration enumerateAllLocations()
Does enumerate inherited Locations.- Specified by:
enumerateAllLocations
in classEnvironment
-
hasMoreElements
protected boolean hasMoreElements(LocationEnumeration it)
- Specified by:
hasMoreElements
in classEnvironment
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
-
readResolve
public Object readResolve() throws ObjectStreamException
- Throws:
ObjectStreamException
-
entrySet
public Set entrySet()
-
toStringVerbose
public String toStringVerbose()
Description copied from class:Environment
Overridden in sub-classes - useful for more verbose debug output.- Overrides:
toStringVerbose
in classEnvironment
-
toStringBase
protected void toStringBase(StringBuffer sbuf)
-
-