gnu.mapping

Class Location

Known Direct 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 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.
Object
get()
Get the current value of this location.
abstract Object
get(Object defaultValue)
Location
getBase()
Object
getKeyProperty()
Symbol
getKeySymbol()
Object
getValue()
boolean
isBound()
boolean
isConstant()
static Location
make(Object init, String name)
static IndirectableLocation
make(String name)
static IndirectableLocation
make(Symbol name)
void
print(java.io.PrintWriter ps)
abstract void
set(Object value)
void
setRestore(Object oldValue, CallContext ctx)
Restore an old value.
Object
setValue(Object newValue)
Object
setWithSave(Object newValue, CallContext ctx)
Set a value, but return cookie so old value can be restored.
String
toString()
void
undefine()

Field Details

UNBOUND

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

Constructor Details

Location

public Location()

Method Details

entered

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

get

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

get

public abstract Object get(Object defaultValue)

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(java.io.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()