public class NodeElement 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 |
---|
NodeElement(java.lang.String labelName)
Creates a new instance of an element node.
|
Modifier and Type | Method and Description |
---|---|
void |
addChildNode(Node childNode)
Adds a new node as the last child node of this parent node.
|
int |
countTreeNodes()
Recursively counts all nodes in the data tree.
|
Node |
getChildNode(int index)
Returns the child number at a given relative position.
|
java.util.List<Node> |
getChildNodes()
Returns the list of all child nodes.
|
java.util.List<Node> |
getChildNodes(int indexFrom,
int indexTo)
Returns the specified subsequence of child 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.
|
generateIndent, getNodeIdentifier, getNodesLabels, toString
public NodeElement(java.lang.String labelName)
labelName
- Element name.public Node getChildNode(int index)
index
- Number of the relative position inside a node.public java.util.List<Node> getChildNodes()
Node
getChildNodes
in class Node
public java.util.List<Node> getChildNodes(int indexFrom, int indexTo)
indexFrom
- Left inclusive boundary.indexTo
- Right exclusive boundary.public void addChildNode(Node childNode)
childNode
- Reference to a new child node.public Node.Type getNodeType()
Node
getNodeType
in class Node
public java.lang.String getNodeLabel()
Node
getNodeLabel
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.