multivalent
Class VObject
public abstract
class
VObject
extends Object
java.lang.Objects with a name and attributes. Superclass of
Behavior and
Node.
Attributes are generally java.lang.Strings,
but
VObjects that are not to be written to a hub can store any java.lang.Object as the
value
.
Most getters optionally take a second value, a default that's returned if the attribute does not exist or cannot be interpreted as the requested type,
rather than throwing an exception in that case.
Also validate, statistics.
Version: $Revision: 1.6 $ $Date: 2003/06/02 05:11:39 $
Field Summary |
protected Map<String,Object> | attr_
All Behaviors and Nodes have attributes, that is, a set (possibly empty) of key, value pairs.
|
Method Summary |
Iterator<Entry<String,Object>> | attrEntrySetIterator() |
Iterator<String> | attrKeysIterator() |
boolean | checkRep()
Checks "representation invariant" (see MIT SE),
and returns true iff object is valid, which should be always |
void | clearAttributes() |
String | getAttr(String key) |
String | getAttr(String key, String default_) Same as getAttr, except if no such key, then return default_. |
Map<String,Object> | getAttributes() Needed for scripting, testing and moving from ESISNode to real node, but not for general use. |
Multivalent | getGlobal() Convenience method to global state in class Multivalent. |
abstract String | getName() |
Object | getValue(String key) Return attribute value that might not be of type String. |
boolean | hasAttributes() DOM2. |
void | putAttr(String key, Object val) If val == null , remove attribute. |
Object | removeAttr(String key)
Returns old value of key. |
void | setAttributes(Map<String,Object> attrs) |
protected Map<String,Object> attr_
All Behaviors and Nodes have attributes, that is, a set (possibly empty) of key, value pairs.
Attributes keys must be Strings, and are canonicalized to all lowercase.
Values must be Strings.
By default, attributes are kept in a CHashMap, which ignores that case of the key;
if a java.util.HashMap is desired, create the object with one.
public final Iterator<Entry<String,Object>> attrEntrySetIterator()
public final Iterator<String> attrKeysIterator()
public boolean checkRep()
Checks "representation invariant" (see
MIT SE),
and returns true iff object is valid, which should be always.
public final void clearAttributes()
public final String getAttr(String key)
public final String getAttr(String key, String default_)
Same as
getAttr, except if no such key, then return
default_.
public final Map<String,Object> getAttributes()
Needed for scripting, testing and moving from ESISNode to real node, but not for general use.
Convenience method to global state in class Multivalent.
public abstract String getName()
public final Object getValue(String key)
Return attribute value that might not be of type String.
public boolean hasAttributes()
DOM2.
public final void putAttr(String key, Object val)
If val == null
, remove attribute.
public final Object removeAttr(String key)
Returns old value of key.
public final void setAttributes(Map<String,Object> attrs)