gnu.mapping
Class ConstrainedLocation

java.lang.Object
  extended by gnu.mapping.Location
      extended by gnu.mapping.ConstrainedLocation
Direct Known Subclasses:
ReadOnlyLocation

public class ConstrainedLocation
extends Location


Field Summary
protected  Location base
           
protected  Procedure converter
           
 
Fields inherited from class gnu.mapping.Location
UNBOUND
 
Constructor Summary
ConstrainedLocation()
           
 
Method Summary
protected  java.lang.Object coerce(java.lang.Object newValue)
           
 java.lang.Object get(java.lang.Object defaultValue)
           
 java.lang.Object getKeyProperty()
           
 Symbol getKeySymbol()
           
 boolean isBound()
           
 boolean isConstant()
           
static ConstrainedLocation make(Location base, Procedure converter)
           
 void set(java.lang.Object newValue)
           
 void setRestore(java.lang.Object oldValue, CallContext ctx)
          Restore an old value.
 java.lang.Object setWithSave(java.lang.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, getBase, getValue, make, make, make, print, setValue, toString, undefine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

base

protected Location base

converter

protected Procedure converter
Constructor Detail

ConstrainedLocation

public ConstrainedLocation()
Method Detail

make

public static ConstrainedLocation make(Location base,
                                       Procedure converter)

getKeySymbol

public Symbol getKeySymbol()
Overrides:
getKeySymbol in class Location

getKeyProperty

public java.lang.Object getKeyProperty()
Overrides:
getKeyProperty in class Location

isConstant

public boolean isConstant()
Overrides:
isConstant in class Location

get

public final java.lang.Object get(java.lang.Object defaultValue)
Specified by:
get in class Location

isBound

public boolean isBound()
Overrides:
isBound in class Location

coerce

protected java.lang.Object coerce(java.lang.Object newValue)

set

public final void set(java.lang.Object newValue)
Specified by:
set in class Location

setWithSave

public java.lang.Object setWithSave(java.lang.Object newValue,
                                    CallContext ctx)
Description copied from class: Location
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 class Location

setRestore

public void setRestore(java.lang.Object oldValue,
                       CallContext ctx)
Description copied from class: Location
Restore an old value.

Overrides:
setRestore in class Location
Parameters:
oldValue - the return value from a prior setWithSave.