Package gnu.mapping
Class PropertyLocation
- java.lang.Object
-
- gnu.mapping.Location<Object>
-
- gnu.mapping.PropertyLocation
-
-
Constructor Summary
Constructors Constructor Description PropertyLocation()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
get()
Get the current value of this location.static Object
getProperty(Object symbol, Object property, Object defaultValue)
Gets a property value associated with an object.static Object
getProperty(Object symbol, Object property, Object defaultValue, Environment env)
Gets a property value associated with an object.static Object
getPropertyList(Object symbol)
Get the property list associated with object in the current Environment.static Object
getPropertyList(Object symbol, Environment env)
Get the property list assocated with an object in a given Environment.boolean
isBound()
static Object
plistGet(Object plist, Object prop, Object dfault)
Given a property list and a key, find the corresponding property value.static Object
plistPut(Object plist, Object prop, Object value)
Modify and add a property binding to a property list.static Object
plistRemove(Object plist, Object prop)
Remove a property binding from a property list.static void
putProperty(Object symbol, Object property, Object newValue)
Sets a property value associated with an object.static void
putProperty(Object symbol, Object property, Object newValue, Environment env)
static boolean
removeProperty(Object symbol, Object property)
Remove a property associated with an object.static boolean
removeProperty(Object symbol, Object property, Environment env)
Remove a properaty assocatied with an object.void
set(Object newValue)
static void
setPropertyList(Object symbol, Object plist)
Set the property list assocated with an object in a given Environment.static void
setPropertyList(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
-
-
-
-
Method Detail
-
get
public final Object get()
Description copied from class:Location
Get the current value of this location.
-
getPropertyList
public static Object getPropertyList(Object symbol, Environment env)
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
public static Object getPropertyList(Object symbol)
Get the property list associated with object in the current Environment. Corresponds to Common Lisp'ssymbol-plist
function.- Parameters:
symbol
- Usually but not necessarily a Symbol. (A String is not converted a Symbol by this method.)
-
setPropertyList
public static void setPropertyList(Object symbol, Object plist, Environment env)
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
public static void setPropertyList(Object symbol, Object plist)
Set the property list assocated with an object in a given Environment. Corresponds to Common Lisp's(setf symbol-plist)
function.
-
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
. AString
is converted to aSymbol
usingenv.getSymbol()
. Symbols require a constant-type hash lookup; other object are searched linearly.
-
getProperty
public static Object getProperty(Object symbol, Object property, Object defaultValue)
Gets a property value associated with an object. Corresponds to Common Lisp'sget
function.
-
putProperty
public static void putProperty(Object symbol, Object property, Object newValue, Environment env)
-
putProperty
public static void putProperty(Object symbol, Object property, Object newValue)
Sets a property value associated with an object. Corresponds to Common Lisp's(setf get)
function.
-
removeProperty
public static boolean removeProperty(Object symbol, Object property, Environment env)
Remove a properaty assocatied with an object.
-
removeProperty
public static boolean removeProperty(Object symbol, Object property)
Remove a property associated with an object. Corresponds to Common Lisp'sremprop
function.
-
plistGet
public static Object plistGet(Object plist, Object prop, Object dfault)
Given a property list and a key, find the corresponding property value.
-
plistPut
public static Object plistPut(Object plist, Object prop, Object value)
Modify and add a property binding to a property list.- Returns:
- The updated property list.
-
-