facets.util.datatree
Class DataNode

java.lang.Object
  extended by facets.util.Tracer
      extended by facets.util.StatefulCore
          extended by facets.util.datatree.TypedNode<java.lang.String>
              extended by facets.util.datatree.DataNode
All Implemented Interfaces:
Identified, Stateful, Titled, java.io.Serializable
Direct Known Subclasses:
ExceptionNode, FileNode, ValueNode

public class DataNode
extends TypedNode<java.lang.String>

Mutable, persistable TypedNode.

DataNode extends its superclass by

See Also:
Serialized Form

Field Summary
 
Fields inherited from class facets.util.datatree.TypedNode
NULL_NODE, UNTITLED
 
Constructor Summary
DataNode(java.lang.String type, java.lang.String title)
           
DataNode(java.lang.String type, java.lang.String title, java.lang.Object[] contents)
           
 
Method Summary
 java.lang.Object[] contents()
          Useful re-implementation.
 Stateful copyState()
          Implements interface method.
 void setChildren(TypedNode... children)
          Removes any existing children, appends those passed to any non-TypedNode contents.
 void setContents(java.lang.Object... contents)
          Replaces any existing contents.
 void setState(java.lang.Object src)
          Valid re-implementation.
 void setValues(java.lang.Object... values)
          Removes any existing values, prepending those passed to any TypedNode contents.
 boolean stateEquals(Stateful other)
          Valid re-implementation.
 java.lang.String toString()
          Re-implementation wrapping Debug.info(Object).
protected  java.lang.String valueString(java.lang.Object value)
          Stringifies values to comply with TypedNode.values().
 
Methods inherited from class facets.util.datatree.TypedNode
children, identity, parent, setParent, setValidType, type, values
 
Methods inherited from class facets.util.StatefulCore
setTitle, stateStamp, title, updateStateStamp
 
Methods inherited from class facets.util.Tracer
trace, trace, trace, trace, trace, traceDebug, traceDebug, traceObjectText, traceOutput, traceOutputWithClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataNode

public DataNode(java.lang.String type,
                java.lang.String title)

DataNode

public DataNode(java.lang.String type,
                java.lang.String title,
                java.lang.Object[] contents)
Method Detail

setContents

public void setContents(java.lang.Object... contents)
Replaces any existing contents.

contents must conform to the contract for contents().


setChildren

public final void setChildren(TypedNode... children)
Removes any existing children, appends those passed to any non-TypedNode contents.

children must conform to the contract for TypedNode.children().


setValues

public final void setValues(java.lang.Object... values)
Removes any existing values, prepending those passed to any TypedNode contents.

Parameters:
values - must

String values may be key pairs in the format key=value where value is stringifiable by the implementation


valueString

protected java.lang.String valueString(java.lang.Object value)
Stringifies values to comply with TypedNode.values().

Parameters:
value - passed from setValues(Object...)
Returns:
a String for return by TypedNode.values()

contents

public java.lang.Object[] contents()
Useful re-implementation.

Overrides:
contents in class TypedNode<java.lang.String>
Returns:
array set (possibly indirectly) by setContents(Object...)

copyState

public Stateful copyState()
Implements interface method.

Returns a deep copy of the node and its contents() with

Specified by:
copyState in interface Stateful
Overrides:
copyState in class TypedNode<java.lang.String>

setState

public void setState(java.lang.Object src)
Valid re-implementation.

Specified by:
setState in interface Stateful
Overrides:
setState in class TypedNode<java.lang.String>
Parameters:
src - must be a TypedNode of the same TypedNode.type()

stateEquals

public final boolean stateEquals(Stateful other)
Valid re-implementation.

Specified by:
stateEquals in interface Stateful
Overrides:
stateEquals in class StatefulCore
Parameters:
other - must be DataNode
Returns:
true if the two trees are byte-identical apart from TypedNode.identity()

toString

public java.lang.String toString()
Description copied from class: StatefulCore
Re-implementation wrapping Debug.info(Object).

Overrides:
toString in class TypedNode<java.lang.String>