public class NodeData extends Node
TOKEN_DT_DATA, TOKEN_DV_UNDEFINED, TOKEN_SE_EOL, TOKEN_SE_INDENT, TOKEN_TG_CLOSE, TOKEN_TG_CLOSE_EMPTY, TOKEN_TG_OPEN_END, TOKEN_TG_OPEN_START
Constructor and Description |
---|
NodeData(java.lang.String dataValue)
Creates a new instance of a data node.
|
Modifier and Type | Method and Description |
---|---|
int |
countTreeNodes()
Recursively counts all nodes in the data tree.
|
java.util.List<Node> |
getChildNodes()
Returns the list of all child nodes.
|
java.lang.String |
getDataValue()
Returns the data value stored in the nodes.
|
java.lang.String |
getNodeLabel()
Returns the node label.
|
Node.Type |
getNodeType()
Returns the type of a given node.
|
Stats |
getTreeStatistics()
Computes the basic statistics about this subtree.
|
void |
serializeNode(java.lang.StringBuilder builder)
Serializes the node into an XML string.
|
void |
serializeNode(java.lang.StringBuilder builder,
int level)
Serializes the node into an indented XML string.
|
void |
setDataValue(java.lang.String newValue)
Sets a new data value of the node.
|
generateIndent, getNodeIdentifier, getNodesLabels, toString
public NodeData(java.lang.String dataValue)
dataValue
- Textual data value.public Node.Type getNodeType()
Node
getNodeType
in class Node
public java.lang.String getNodeLabel()
Node
getNodeLabel
in class Node
public java.lang.String getDataValue()
TOKEN_DV_UNDEFINED
.public void setDataValue(java.lang.String newValue)
newValue
- Data value or TOKEN_DV_UNDEFINED
.public java.util.List<Node> getChildNodes()
Node
getChildNodes
in class Node
public int countTreeNodes()
Node
countTreeNodes
in class Node
public Stats getTreeStatistics()
Node
getTreeStatistics
in class Node
public void serializeNode(java.lang.StringBuilder builder)
Node
serializeNode
in class Node
builder
- String builder for serialization output.public void serializeNode(java.lang.StringBuilder builder, int level)
Node
serializeNode
in class Node
builder
- String builder for serialization output.level
- Level of recursive nesting for indentation.