public class ThreadLocation<T> extends NamedLocation<T> implements Named
Modifier and Type | Class and Description |
---|---|
class |
ThreadLocation.InheritingLocation<T> |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ANONYMOUS
Magic property value used for the "anonymous" ThreadLocations.
|
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,
java.lang.Object property,
SharedLocation global) |
Modifier and Type | Method and Description |
---|---|
T |
get()
Get the current value of this location.
|
T |
get(T defaultValue) |
static ThreadLocation |
getInstance(Symbol name,
java.lang.Object property)
For a given (Symbol.
|
NamedLocation<T> |
getLocation()
Get the thread-specific Location for this Location.
|
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.
|
entered, equals, getEnvironment, getKey, getKeyProperty, getKeySymbol, hashCode, matches, matches
getBase, getBaseForce, isConstant, setAlias, setBase, undefine
getValue, make, make, make, print, setValue, toString
public static final java.lang.String ANONYMOUS
public ThreadLocation()
public ThreadLocation(java.lang.String name)
public ThreadLocation(Symbol name, java.lang.Object property, SharedLocation global)
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 NamedLocation<T> getLocation()
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 static ThreadLocation getInstance(Symbol name, java.lang.Object property)