gnu.mapping
Class Location

java.lang.Object
  extended by gnu.mapping.Location
Direct Known Subclasses:
ClassMemberLocation, ConstrainedLocation, IndirectableLocation, ProcLocation, PropertyLocation, ThreadLocation

public abstract class Location
extends java.lang.Object

A Location is an abstract cell/location/variable with a value.


Field Summary
static java.lang.String UNBOUND
          Magic value used to indicate there is no property binding.
 
Constructor Summary
Location()
           
 
Method Summary
 boolean entered()
          True if directly entered in an Environment.
 java.lang.Object get()
          Get the current value of this location.
abstract  java.lang.Object get(java.lang.Object defaultValue)
           
 Location getBase()
           
 java.lang.Object getKeyProperty()
           
 Symbol getKeySymbol()
           
 java.lang.Object getValue()
           
 boolean isBound()
           
 boolean isConstant()
           
static Location make(java.lang.Object init, java.lang.String name)
           
static IndirectableLocation make(java.lang.String name)
           
static IndirectableLocation make(Symbol name)
           
 void print(java.io.PrintWriter ps)
           
abstract  void set(java.lang.Object value)
           
 void setRestore(java.lang.Object oldValue, CallContext ctx)
          Restore an old value.
 java.lang.Object setValue(java.lang.Object newValue)
           
 java.lang.Object setWithSave(java.lang.Object newValue, CallContext ctx)
          Set a value, but return cookie so old value can be restored.
 java.lang.String toString()
           
 void undefine()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNBOUND

public static final java.lang.String UNBOUND
Magic value used to indicate there is no property binding.

Constructor Detail

Location

public Location()
Method Detail

getKeySymbol

public Symbol getKeySymbol()

getKeyProperty

public java.lang.Object getKeyProperty()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

get

public abstract java.lang.Object get(java.lang.Object defaultValue)

get

public final java.lang.Object get()
Get the current value of this location.

Throws:
UnboundLocationException - the location does not have a value.

set

public abstract void set(java.lang.Object value)

undefine

public void undefine()

setWithSave

public java.lang.Object setWithSave(java.lang.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.


setRestore

public void setRestore(java.lang.Object oldValue,
                       CallContext ctx)
Restore an old value.

Parameters:
oldValue - the return value from a prior setWithSave.

isBound

public boolean isBound()

isConstant

public boolean isConstant()

getBase

public Location getBase()

getValue

public final java.lang.Object getValue()

setValue

public final java.lang.Object setValue(java.lang.Object newValue)

entered

public boolean entered()
True if directly entered in an Environment. (Only if NamedLocation.)


print

public void print(java.io.PrintWriter ps)

make

public static Location make(java.lang.Object init,
                            java.lang.String name)

make

public static IndirectableLocation make(java.lang.String name)

make

public static IndirectableLocation make(Symbol name)