Package gnu.mapping
Class ConstrainedLocation<T>
- java.lang.Object
-
- gnu.mapping.Location<T>
-
- gnu.mapping.ConstrainedLocation<T>
-
- Direct Known Subclasses:
ReadOnlyLocation
public class ConstrainedLocation<T> extends Location<T>
-
-
Constructor Summary
Constructors Constructor Description ConstrainedLocation()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Tcoerce(T newValue)Tget()Get the current value of this location.Tget(T defaultValue)ObjectgetKeyProperty()SymbolgetKeySymbol()booleanisBound()booleanisConstant()static <T> ConstrainedLocation<T>make(Location<T> base, Procedure converter)voidset(T newValue)voidsetRestore(Object oldValue)Restore an old value.ObjectsetWithSave(T newValue)Set a value, but return cookie so old value can be restored.voidundefine()
-
-
-
Method Detail
-
make
public static <T> ConstrainedLocation<T> make(Location<T> base, Procedure converter)
-
getKeySymbol
public Symbol getKeySymbol()
- Overrides:
getKeySymbolin classLocation<T>
-
getKeyProperty
public Object getKeyProperty()
- Overrides:
getKeyPropertyin classLocation<T>
-
isConstant
public boolean isConstant()
- Overrides:
isConstantin classLocation<T>
-
get
public final T get()
Description copied from class:LocationGet the current value of this location.
-
setWithSave
public Object setWithSave(T newValue)
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 classLocation<T>
-
setRestore
public void setRestore(Object oldValue)
Description copied from class:LocationRestore an old value.- Overrides:
setRestorein classLocation<T>- Parameters:
oldValue- the return value from a prior setWithSave.
-
-