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 -
Method Summary
Modifier and TypeMethodDescriptionboolean
entered()
True if directly entered in an Environment.boolean
final EnvironmentKey
getKey()
final Object
final Symbol
int
hashCode()
final boolean
matches
(EnvironmentKey key) final boolean
void
setRestore
(Object oldValue) Restore an old value.setWithSave
(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 Details
-
NamedLocation
-
NamedLocation
-
-
Method Details
-
entered
public boolean entered()Description copied from class:Location
True if directly entered in an Environment. (Only if NamedLocation.) -
getEnvironment
- Overrides:
getEnvironment
in classIndirectableLocation<T>
-
getKeySymbol
- Specified by:
getKeySymbol
in interfaceEnvironmentKey
- Overrides:
getKeySymbol
in classIndirectableLocation<T>
-
getKeyProperty
- Specified by:
getKeyProperty
in interfaceEnvironmentKey
- Overrides:
getKeyProperty
in classIndirectableLocation<T>
-
matches
- Specified by:
matches
in interfaceEnvironmentKey
-
matches
- Specified by:
matches
in interfaceEnvironmentKey
-
getKey
- Specified by:
getKey
in interfaceMap.Entry<EnvironmentKey,
T>
-
equals
-
hashCode
public int hashCode() -
setWithSave
Description copied from class:Location
Set 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:
setWithSave
in classLocation<T>
-
setRestore
Description copied from class:Location
Restore an old value.- Overrides:
setRestore
in classLocation<T>
- Parameters:
oldValue
- the return value from a prior setWithSave.
-