gnu.mapping

Class ConstrainedLocation

Known Direct Subclasses:
ReadOnlyLocation

public class ConstrainedLocation
extends Location

Field Summary

protected Location
base
protected Procedure
converter

Fields inherited from class gnu.mapping.Location

UNBOUND

Method Summary

protected Object
coerce(Object newValue)
Object
get(Object defaultValue)
Object
getKeyProperty()
Symbol
getKeySymbol()
boolean
isBound()
boolean
isConstant()
static ConstrainedLocation
make(Location base, Procedure converter)
void
set(Object newValue)
void
setRestore(Object oldValue, CallContext ctx)
Restore an old value.
Object
setWithSave(Object newValue, CallContext ctx)
Set a value, but return cookie so old value can be restored.

Methods inherited from class gnu.mapping.Location

entered, get, get, getBase, getKeyProperty, getKeySymbol, getValue, isBound, isConstant, make, make, make, print, set, setRestore, setValue, setWithSave, toString, undefine

Field Details

base

protected Location base

converter

protected Procedure converter

Method Details

coerce

protected Object coerce(Object newValue)

get

public final Object get(Object defaultValue)
Overrides:
get in interface Location

getKeyProperty

public Object getKeyProperty()
Overrides:
getKeyProperty in interface Location

getKeySymbol

public Symbol getKeySymbol()
Overrides:
getKeySymbol in interface Location

isBound

public boolean isBound()
Overrides:
isBound in interface Location

isConstant

public boolean isConstant()
Overrides:
isConstant in interface Location

make

public static ConstrainedLocation make(Location base,
                                       Procedure converter)

set

public final void set(Object newValue)
Overrides:
set in interface Location

setRestore

public void setRestore(Object oldValue,
                       CallContext ctx)
Restore an old value.
Overrides:
setRestore in interface Location
Parameters:
oldValue - the return value from a prior setWithSave.

setWithSave

public Object setWithSave(Object newValue,
                          CallContext ctx)
Set 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:
setWithSave in interface Location