Package gnu.mapping
Class ThreadLocation<T>
java.lang.Object
gnu.mapping.Location<T>
gnu.mapping.IndirectableLocation<T>
gnu.mapping.NamedLocation<T>
gnu.mapping.ThreadLocation<T>
- All Implemented Interfaces:
EnvironmentKey,Named,Map.Entry<EnvironmentKey,T>
A Location that forwards to a thread-specific Location.
-
Field Summary
Fields inherited from class gnu.mapping.IndirectableLocation
base, DIRECT_ON_SET, INDIRECT_FLUIDS, valueFields inherited from interface gnu.mapping.EnvironmentKey
FUNCTION -
Constructor Summary
ConstructorsConstructorDescriptionA new anonymous fluid location.ThreadLocation(Symbol name) ThreadLocation(Symbol name, ThreadLocal<T> thLocal) ThreadLocation(String name) A new anonymous fluid location but used a given name for printing. -
Method Summary
Modifier and TypeMethodDescriptionget()Get the current value of this location.getName()booleanisBound()static ThreadLocationmakeAnonymous(Symbol name) Create a fresh ThreadLocation, independent of other ThreadLocations.static ThreadLocationmakeAnonymous(String name) Create a fresh ThreadLocation, independent of other ThreadLocations.voidvoidSet the default/global value.voidvoidsetRestore(Object oldValue) Restore an old value.setWithSave(T newValue) Set a value, but return cookie so old value can be restored.voidundefine()Methods inherited from class gnu.mapping.NamedLocation
entered, equals, getEnvironment, getKey, getKeyProperty, getKeySymbol, hashCode, matches, matchesMethods inherited from class gnu.mapping.IndirectableLocation
getBase, getBaseForce, isConstant, setAlias, setBaseMethods inherited from class gnu.mapping.Location
define, getValue, make, make, make, print, setValue, toString
-
Constructor Details
-
ThreadLocation
public ThreadLocation()A new anonymous fluid location. -
ThreadLocation
A new anonymous fluid location but used a given name for printing. However, the binding is not bound to the name as a visible binding. -
ThreadLocation
-
ThreadLocation
-
-
Method Details
-
makeAnonymous
Create a fresh ThreadLocation, independent of other ThreadLocations.- Parameters:
name- used for printing, but not identification.
-
makeAnonymous
Create a fresh ThreadLocation, independent of other ThreadLocations.- Parameters:
name- used for printing, but not identification.
-
setGlobal
Set the default/global value. -
get
Description copied from class:LocationGet the current value of this location. -
get
-
isBound
public boolean isBound() -
set
-
setWithSave
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 classNamedLocation<T>
-
setRestore
Description copied from class:LocationRestore an old value.- Overrides:
setRestorein classNamedLocation<T>- Parameters:
oldValue- the return value from a prior setWithSave.
-
undefine
public void undefine()- Overrides:
undefinein classIndirectableLocation<T>
-
getName
-
getSymbol
-
setName
-