Package gnu.mapping
Class IndirectableLocation<T>
- java.lang.Object
-
- gnu.mapping.Location<T>
-
- gnu.mapping.IndirectableLocation<T>
-
- Direct Known Subclasses:
NamedLocation
public abstract class IndirectableLocation<T> extends Location<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected Location<T>
base
If non-null, operations are forwarded to the base location.protected static Object
DIRECT_ON_SET
Ifvalue==DIRECT_ON_SET
, break indirection on aset
.protected static Object
INDIRECT_FLUIDS
Ifvalue
has this value, force indirection even for thesetWithSave
operation.protected Object
value
Ifbase
is null, the current value stored in thisLocation
.
-
Constructor Summary
Constructors Constructor Description IndirectableLocation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Location
getBase()
Location
getBaseForce()
Environment
getEnvironment()
Object
getKeyProperty()
Symbol
getKeySymbol()
boolean
isConstant()
void
setAlias(Location base)
Define this Location as an alias for some other Location.void
setBase(Location base)
void
undefine()
-
-
-
Field Detail
-
DIRECT_ON_SET
protected static final Object DIRECT_ON_SET
Ifvalue==DIRECT_ON_SET
, break indirection on aset
.
-
INDIRECT_FLUIDS
protected static final Object INDIRECT_FLUIDS
Ifvalue
has this value, force indirection even for thesetWithSave
operation. Ignoring the restore aspect of afluid-let
, it is normally treated as closer to adefine
than to aset
, in that we break the sharing with anotherEnvironment
. Settingvalue
toINDIRECT_FLUIDS
means we do not want to break the indirection in this case.
-
value
protected Object value
Ifbase
is null, the current value stored in thisLocation
. Ifbase
is non-null, thenvalue
is generally ignored. However, the special valueDIRECT_ON_SET
means that writes changevalue
directly, instead of setting the value ofbase
.
-
-
Method Detail
-
getKeySymbol
public Symbol getKeySymbol()
- Overrides:
getKeySymbol
in classLocation<T>
-
getKeyProperty
public Object getKeyProperty()
- Overrides:
getKeyProperty
in classLocation<T>
-
isConstant
public boolean isConstant()
- Overrides:
isConstant
in classLocation<T>
-
getBaseForce
public Location getBaseForce()
-
setBase
public void setBase(Location base)
-
setAlias
public void setAlias(Location base)
Define this Location as an alias for some other Location.
-
getEnvironment
public Environment getEnvironment()
-
-