public class ConstrainedLocation<T> extends Location<T>
Modifier and Type | Field and Description |
---|---|
protected Location<T> |
base |
protected Procedure |
converter |
Constructor and Description |
---|
ConstrainedLocation() |
Modifier and Type | Method and Description |
---|---|
protected T |
coerce(T newValue) |
T |
get()
Get the current value of this location.
|
T |
get(T defaultValue) |
java.lang.Object |
getKeyProperty() |
Symbol |
getKeySymbol() |
boolean |
isBound() |
boolean |
isConstant() |
static <T> ConstrainedLocation<T> |
make(Location<T> base,
Procedure converter) |
void |
set(T newValue) |
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() |
public static <T> ConstrainedLocation<T> make(Location<T> base, Procedure converter)
public Symbol getKeySymbol()
getKeySymbol
in class Location<T>
public java.lang.Object getKeyProperty()
getKeyProperty
in class Location<T>
public boolean isConstant()
isConstant
in class Location<T>
public final T get()
Location
public java.lang.Object setWithSave(T newValue)
Location
setWithSave
in class Location<T>
public void setRestore(java.lang.Object oldValue)
Location
setRestore
in class Location<T>
oldValue
- the return value from a prior setWithSave.