|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sapia.archie.AbstractNode
org.sapia.archie.impl.MultiValueNode
public class MultiValueNode
An instance of this class tolerates multiple values under the same name.
| Field Summary | |
|---|---|
protected java.util.Map |
_valueLists
|
| Fields inherited from class org.sapia.archie.AbstractNode |
|---|
_children, _fac |
| Constructor Summary | |
|---|---|
protected |
MultiValueNode(java.util.Map children,
java.util.Map values,
NodeFactory fac)
|
protected |
MultiValueNode(NameParser parser,
java.util.Map children,
java.util.Map values,
NodeFactory fac)
|
| Method Summary | |
|---|---|
java.util.Iterator |
getChildren()
Returns this instance's child nodes. |
int |
getChildrenCount()
Returns the number of children that this instance contains. |
java.util.Iterator |
getChildrenNames()
Returns the names of this instance's nodes. |
java.util.Iterator |
getEntries()
|
java.lang.Object |
getValue(NamePart name)
This method calls onSelect() and onRead() successively, before returning the a value. |
int |
getValueCount()
Returns the number of values that this instance contains. |
java.util.Iterator |
getValueNames()
Returns the names of this instance's values. |
protected java.lang.Object |
onRead(NamePart np,
java.lang.Object selected)
This method is internally called by getValue(...). |
protected java.lang.Object |
onSelect(java.util.List values)
Selects a given value, from the given list, and returns it. |
protected java.lang.Object |
onWrite(NamePart np,
java.lang.Object toBind)
Called prior to bind the given object to the given name part. |
boolean |
putValue(NamePart name,
java.lang.Object value,
boolean overwrite)
Put a value into this node; overwrites the existing value - if any. |
java.lang.Object |
removeValue(NamePart name)
Internally removes the value that this node holds and returns it. |
| Methods inherited from class org.sapia.archie.AbstractNode |
|---|
createChild, getAbsolutePath, getChild, getName, getNameParser, getParent, removeChild, setUp, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Map _valueLists
| Constructor Detail |
|---|
protected MultiValueNode(java.util.Map children,
java.util.Map values,
NodeFactory fac)
throws ProcessingException
ProcessingException
protected MultiValueNode(NameParser parser,
java.util.Map children,
java.util.Map values,
NodeFactory fac)
throws ProcessingException
ProcessingException| Method Detail |
|---|
public java.lang.Object getValue(NamePart name)
Object, or null if this node has
no value.onSelect(List),
onRead(NamePart, Object),
Node.getValue(NamePart)public java.lang.Object removeValue(NamePart name)
Node
Object, or null if this node has
no value.Node.removeValue(org.sapia.archie.NamePart)public java.util.Iterator getEntries()
Iterator of Entry instances,
corresponding to the bindings that this instance holds.Node.getEntries()
public boolean putValue(NamePart name,
java.lang.Object value,
boolean overwrite)
Node
name - the name under which to bind the given value.value - an Object.overwrite - if true, overwrites the already existing value
for the given name - it such is the case.
true if the given value was added. Returns false
if overwrite is false and a value already exists for the
given name.Node.putValue(NamePart, Object, boolean)public java.util.Iterator getValueNames()
Node
Iterator of NameParts.Node.getValueNames()public int getValueCount()
Node
Node.getValueCount()public int getChildrenCount()
Node
getChildrenCount in interface NodegetChildrenCount in class AbstractNodeNode.getChildrenCount()public java.util.Iterator getChildrenNames()
Node
getChildrenNames in interface NodegetChildrenNames in class AbstractNodeIterator of NameParts.Node.getChildrenNames()public java.util.Iterator getChildren()
Node
getChildren in interface NodegetChildren in class AbstractNodeIterator of Nodes.Node.getChildren()protected java.lang.Object onSelect(java.util.List values)
getValue(...).
values - the list of values to select from.
getValue(NamePart)
protected java.lang.Object onRead(NamePart np,
java.lang.Object selected)
getValue(...).
np - the name under which the selected object is bound.selected - the selected object.
getValue(NamePart)
protected java.lang.Object onWrite(NamePart np,
java.lang.Object toBind)
np - the NamePart under which the given object
is to be bound.toBind - the object to bind.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||