Package gnu.mapping
Class PropertyLocation
Used to implement Lisp-style "property lists".
A
PropertyLocation is a location whose value is the
car of a property list.
This class also contains a number of static methods useful for
working with property lists.-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Objectget()Get the current value of this location.static ObjectgetProperty(Object symbol, Object property, Object defaultValue) Gets a property value associated with an object.static ObjectgetProperty(Object symbol, Object property, Object defaultValue, Environment env) Gets a property value associated with an object.static ObjectgetPropertyList(Object symbol) Get the property list associated with object in the current Environment.static ObjectgetPropertyList(Object symbol, Environment env) Get the property list assocated with an object in a given Environment.booleanisBound()static ObjectGiven a property list and a key, find the corresponding property value.static ObjectModify and add a property binding to a property list.static ObjectplistRemove(Object plist, Object prop) Remove a property binding from a property list.static voidputProperty(Object symbol, Object property, Object newValue) Sets a property value associated with an object.static voidputProperty(Object symbol, Object property, Object newValue, Environment env) static booleanremoveProperty(Object symbol, Object property) Remove a property associated with an object.static booleanremoveProperty(Object symbol, Object property, Environment env) Remove a properaty assocatied with an object.final voidstatic voidsetPropertyList(Object symbol, Object plist) Set the property list assocated with an object in a given Environment.static voidsetPropertyList(Object symbol, Object plist, Environment env) Set the property list assocated with an object in a given Environment.Methods inherited from class gnu.mapping.Location
define, entered, get, getBase, getKeyProperty, getKeySymbol, getValue, isConstant, make, make, make, print, setRestore, setValue, setWithSave, toString, undefine
-
Constructor Details
-
PropertyLocation
public PropertyLocation()
-
-
Method Details
-
get
Description copied from class:LocationGet the current value of this location. -
isBound
public boolean isBound() -
set
-
getPropertyList
Get the property list assocated with an object in a given Environment.- Parameters:
symbol- Usually but not necessarily a Symbol. (A String is not converted a Symbol by this method.)
-
getPropertyList
Get the property list associated with object in the current Environment. Corresponds to Common Lisp'ssymbol-plistfunction.- Parameters:
symbol- Usually but not necessarily a Symbol. (A String is not converted a Symbol by this method.)
-
setPropertyList
Set the property list assocated with an object in a given Environment. This function should be avoided, since a Symbol's property list may be used by unknown classes. It also can be slow.- Parameters:
symbol- Usually but not necessarily a Symbol. (A String is not converted a Symbol by this method.)
-
setPropertyList
Set the property list assocated with an object in a given Environment. Corresponds to Common Lisp's(setf symbol-plist)function.- See Also:
-
getProperty
public static Object getProperty(Object symbol, Object property, Object defaultValue, Environment env) Gets a property value associated with an object.- Parameters:
symbol- Usually aSymbol, but can be anyObject. AStringis converted to aSymbolusingenv.getSymbol(). Symbols require a constant-type hash lookup; other object are searched linearly.
-
getProperty
Gets a property value associated with an object. Corresponds to Common Lisp'sgetfunction.- See Also:
-
putProperty
-
putProperty
Sets a property value associated with an object. Corresponds to Common Lisp's(setf get)function. -
removeProperty
Remove a properaty assocatied with an object. -
removeProperty
Remove a property associated with an object. Corresponds to Common Lisp'srempropfunction. -
plistGet
Given a property list and a key, find the corresponding property value. -
plistPut
Modify and add a property binding to a property list.- Returns:
- The updated property list.
-
plistRemove
Remove a property binding from a property list.- Returns:
- The updated property list.
-