public class ThreadLocation<T> extends NamedLocation<T> implements Named
base, DIRECT_ON_SET, INDIRECT_FLUIDS, value
FUNCTION
Constructor and Description |
---|
ThreadLocation()
A new anonymous fluid location.
|
ThreadLocation(java.lang.String name)
A new anonymous fluid location but used a given name for printing.
|
ThreadLocation(Symbol name) |
ThreadLocation(Symbol name,
java.lang.ThreadLocal<T> thLocal) |
Modifier and Type | Method and Description |
---|---|
T |
get()
Get the current value of this location.
|
T |
get(T defaultValue) |
java.lang.String |
getName() |
java.lang.Object |
getSymbol() |
boolean |
isBound() |
static ThreadLocation |
makeAnonymous(java.lang.String name)
Create a fresh ThreadLocation, independent of other ThreadLocations.
|
static ThreadLocation |
makeAnonymous(Symbol name)
Create a fresh ThreadLocation, independent of other ThreadLocations.
|
void |
set(T value) |
void |
setGlobal(T value)
Set the default/global value.
|
void |
setName(java.lang.String name) |
void |
setRestore(java.lang.Object oldValue)
Restore an old value.
|
java.lang.Object |
setWithSave(T newValue)
Set a value, but return cookie so old value can be restored.
|
void |
undefine() |
entered, equals, getEnvironment, getKey, getKeyProperty, getKeySymbol, hashCode, matches, matches
getBase, getBaseForce, isConstant, setAlias, setBase
define, getValue, make, make, make, print, setValue, toString
public ThreadLocation()
public ThreadLocation(java.lang.String name)
public ThreadLocation(Symbol name)
public static ThreadLocation makeAnonymous(java.lang.String name)
name
- used for printing, but not identification.public static ThreadLocation makeAnonymous(Symbol name)
name
- used for printing, but not identification.public void setGlobal(T value)
public java.lang.Object setWithSave(T newValue)
Location
setWithSave
in class NamedLocation<T>
public void setRestore(java.lang.Object oldValue)
Location
setRestore
in class NamedLocation<T>
oldValue
- the return value from a prior setWithSave.public void undefine()
undefine
in class IndirectableLocation<T>