gnu.mapping

Class Location

public abstract class Location extends Object

A Location is an abstract cell/location/variable with a value.
Field Summary
static StringUNBOUND
Magic value used to indicate there is no property binding.
Constructor Summary
Location()
Method Summary
booleanentered()
True if directly entered in an Environment.
abstract Objectget(Object defaultValue)
Objectget()
Get the current value of this location.
LocationgetBase()
ObjectgetKeyProperty()
SymbolgetKeySymbol()
ObjectgetValue()
booleanisBound()
booleanisConstant()
static Locationmake(Object init, String name)
static IndirectableLocationmake(String name)
static IndirectableLocationmake(Symbol name)
voidprint(PrintWriter ps)
abstract voidset(Object value)
voidsetRestore(Object oldValue, CallContext ctx)
Restore an old value.
ObjectsetValue(Object newValue)
ObjectsetWithSave(Object newValue, CallContext ctx)
Set a value, but return cookie so old value can be restored.
StringtoString()
voidundefine()

Field Detail

UNBOUND

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

Constructor Detail

Location

public Location()

Method Detail

entered

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

get

public abstract Object get(Object defaultValue)

get

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

Throws: UnboundLocationException the location does not have a value.

getBase

public Location getBase()

getKeyProperty

public Object getKeyProperty()

getKeySymbol

public Symbol getKeySymbol()

getValue

public final Object getValue()

isBound

public boolean isBound()

isConstant

public boolean isConstant()

make

public static Location make(Object init, String name)

make

public static IndirectableLocation make(String name)

make

public static IndirectableLocation make(Symbol name)

print

public void print(PrintWriter ps)

set

public abstract void set(Object value)

setRestore

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

Parameters: oldValue the return value from a prior setWithSave.

setValue

public final Object setValue(Object newValue)

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.

toString

public String toString()

undefine

public void undefine()