gnu.mapping
Class NamedLocation

java.lang.Object
  extended by gnu.mapping.Location
      extended by gnu.mapping.IndirectableLocation
          extended by gnu.mapping.NamedLocation
All Implemented Interfaces:
EnvironmentKey, java.util.Map.Entry
Direct Known Subclasses:
PlainLocation, SharedLocation

public abstract class NamedLocation
extends IndirectableLocation
implements java.util.Map.Entry, EnvironmentKey

A Location that can be used as an entry in an Environment.


Field Summary
 
Fields inherited from class gnu.mapping.IndirectableLocation
base, DIRECT_ON_SET, INDIRECT_FLUIDS, value
 
Fields inherited from class gnu.mapping.Location
UNBOUND
 
Fields inherited from interface gnu.mapping.EnvironmentKey
FUNCTION
 
Constructor Summary
NamedLocation(NamedLocation loc)
           
NamedLocation(Symbol name, java.lang.Object property)
           
 
Method Summary
 boolean entered()
          True if directly entered in an Environment.
 boolean equals(java.lang.Object x)
           
 Environment getEnvironment()
           
 java.lang.Object getKey()
           
 java.lang.Object getKeyProperty()
           
 Symbol getKeySymbol()
           
 int hashCode()
           
 boolean matches(EnvironmentKey key)
           
 boolean matches(Symbol symbol, java.lang.Object property)
           
 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.IndirectableLocation
getBase, isConstant, setAlias, setBase, undefine
 
Methods inherited from class gnu.mapping.Location
get, get, getValue, isBound, make, make, make, print, set, setValue, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map.Entry
getValue, setValue
 

Constructor Detail

NamedLocation

public NamedLocation(NamedLocation loc)

NamedLocation

public NamedLocation(Symbol name,
                     java.lang.Object property)
Method Detail

entered

public boolean entered()
Description copied from class: Location
True if directly entered in an Environment. (Only if NamedLocation.)

Overrides:
entered in class Location

getEnvironment

public Environment getEnvironment()
Overrides:
getEnvironment in class IndirectableLocation

getKeySymbol

public final Symbol getKeySymbol()
Specified by:
getKeySymbol in interface EnvironmentKey
Overrides:
getKeySymbol in class IndirectableLocation

getKeyProperty

public final java.lang.Object getKeyProperty()
Specified by:
getKeyProperty in interface EnvironmentKey
Overrides:
getKeyProperty in class IndirectableLocation

matches

public final boolean matches(EnvironmentKey key)
Specified by:
matches in interface EnvironmentKey

matches

public final boolean matches(Symbol symbol,
                             java.lang.Object property)
Specified by:
matches in interface EnvironmentKey

getKey

public final java.lang.Object getKey()
Specified by:
getKey in interface java.util.Map.Entry

equals

public boolean equals(java.lang.Object x)
Specified by:
equals in interface java.util.Map.Entry
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Map.Entry
Overrides:
hashCode in class java.lang.Object

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.