Package gnu.mapping
Class NamedLocation<T>
- java.lang.Object
-
- gnu.mapping.Location<T>
-
- gnu.mapping.IndirectableLocation<T>
-
- gnu.mapping.NamedLocation<T>
-
- All Implemented Interfaces:
EnvironmentKey,Map.Entry<EnvironmentKey,T>
- Direct Known Subclasses:
AbstractScriptEngineFactory.BindingsLocation,DynamicLocation,PlainLocation,SharedLocation,ThreadLocation
public abstract class NamedLocation<T> extends IndirectableLocation<T> implements Map.Entry<EnvironmentKey,T>, EnvironmentKey
A Location that can be used as an entry in an Environment.
-
-
Field Summary
-
Fields inherited from class gnu.mapping.IndirectableLocation
base, DIRECT_ON_SET, INDIRECT_FLUIDS, value
-
Fields inherited from interface gnu.mapping.EnvironmentKey
FUNCTION
-
-
Constructor Summary
Constructors Constructor Description NamedLocation(NamedLocation loc)NamedLocation(Symbol name, Object property)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanentered()True if directly entered in an Environment.booleanequals(Object x)EnvironmentgetEnvironment()EnvironmentKeygetKey()ObjectgetKeyProperty()SymbolgetKeySymbol()inthashCode()booleanmatches(EnvironmentKey key)booleanmatches(Symbol symbol, Object property)voidsetRestore(Object oldValue)Restore an old value.ObjectsetWithSave(T newValue)Set a value, but return cookie so old value can be restored.-
Methods inherited from class gnu.mapping.IndirectableLocation
getBase, getBaseForce, isConstant, setAlias, setBase, undefine
-
Methods inherited from class gnu.mapping.Location
define, get, get, getValue, isBound, make, make, make, print, set, setValue, toString
-
-
-
-
Constructor Detail
-
NamedLocation
public NamedLocation(NamedLocation loc)
-
-
Method Detail
-
entered
public boolean entered()
Description copied from class:LocationTrue if directly entered in an Environment. (Only if NamedLocation.)
-
getEnvironment
public Environment getEnvironment()
- Overrides:
getEnvironmentin classIndirectableLocation<T>
-
getKeySymbol
public final Symbol getKeySymbol()
- Specified by:
getKeySymbolin interfaceEnvironmentKey- Overrides:
getKeySymbolin classIndirectableLocation<T>
-
getKeyProperty
public final Object getKeyProperty()
- Specified by:
getKeyPropertyin interfaceEnvironmentKey- Overrides:
getKeyPropertyin classIndirectableLocation<T>
-
matches
public final boolean matches(EnvironmentKey key)
- Specified by:
matchesin interfaceEnvironmentKey
-
matches
public final boolean matches(Symbol symbol, Object property)
- Specified by:
matchesin interfaceEnvironmentKey
-
getKey
public final EnvironmentKey getKey()
- Specified by:
getKeyin interfaceMap.Entry<EnvironmentKey,T>
-
equals
public boolean equals(Object x)
-
hashCode
public int hashCode()
-
setWithSave
public Object setWithSave(T newValue)
Description copied from class:LocationSet a value, but return cookie so old value can be restored. This is intended for fluid-let where (in the case of multiple threads) a simple save-restore isn't always the right thing.- Overrides:
setWithSavein classLocation<T>
-
setRestore
public void setRestore(Object oldValue)
Description copied from class:LocationRestore an old value.- Overrides:
setRestorein classLocation<T>- Parameters:
oldValue- the return value from a prior setWithSave.
-
-