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 NamedLocationaddLocation(Symbol name, Object property, Location loc)protected NamedLocationaddUnboundLocation(Symbol name, Object property, int hash)NamedLocationdefine(Symbol sym, Object property, int hash, Object newValue)voiddefine(Symbol sym, Object property, Object newValue)SetentrySet()LocationEnumerationenumerateAllLocations()Does enumerate inherited Locations.LocationEnumerationenumerateLocations()Does not enumerate inherited Locations.static LocationgetCurrentLocation(String name)NamedLocationgetLocation(Symbol name, Object property, int hash, boolean create)protected booleanhasMoreElements(LocationEnumeration it)NamedLocationlookup(Symbol name, Object property, int hash)static Objectlookup_global(Symbol name)NamedLocationlookupDirect(Symbol name, Object property, int hash)protected NamedLocationnewLocation(Symbol name, Object property)voidput(Symbol key, Object property, Object newValue)voidreadExternal(ObjectInput in)ObjectreadResolve()protected voidredefineError(Symbol name, Object property, Location loc)intsize()Size does not include inherited Locations.protected voidtoStringBase(StringBuffer sbuf)StringtoStringVerbose()Overridden in sub-classes - useful for more verbose debug output.Locationunlink(Symbol symbol, Object property, int hash)Remove Location from this Environment.voidwriteExternal(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:
lookupin 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:
getLocationin classEnvironment
-
addUnboundLocation
protected NamedLocation addUnboundLocation(Symbol name, Object property, int hash)
-
put
public void put(Symbol key, Object property, Object newValue)
- Overrides:
putin 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:
definein classEnvironment
-
addLocation
public NamedLocation addLocation(Symbol name, Object property, Location loc)
- Specified by:
addLocationin classEnvironment
-
unlink
public Location unlink(Symbol symbol, Object property, int hash)
Description copied from class:EnvironmentRemove Location from this Environment. Does not explicitly undefine the location itself.- Overrides:
unlinkin classEnvironment
-
enumerateLocations
public LocationEnumeration enumerateLocations()
Does not enumerate inherited Locations.- Specified by:
enumerateLocationsin classEnvironment
-
enumerateAllLocations
public LocationEnumeration enumerateAllLocations()
Does enumerate inherited Locations.- Specified by:
enumerateAllLocationsin classEnvironment
-
hasMoreElements
protected boolean hasMoreElements(LocationEnumeration it)
- Specified by:
hasMoreElementsin classEnvironment
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Throws:
IOExceptionClassNotFoundException
-
readResolve
public Object readResolve() throws ObjectStreamException
- Throws:
ObjectStreamException
-
entrySet
public Set entrySet()
-
toStringVerbose
public String toStringVerbose()
Description copied from class:EnvironmentOverridden in sub-classes - useful for more verbose debug output.- Overrides:
toStringVerbosein classEnvironment
-
toStringBase
protected void toStringBase(StringBuffer sbuf)
-
-