org.parboiled.trees
Class ImmutableTreeNode<T extends TreeNode<T>>

java.lang.Object
  extended by org.parboiled.trees.ImmutableGraphNode<T>
      extended by org.parboiled.trees.ImmutableTreeNode<T>
Type Parameters:
T - the actual implementation type of this ImmutableTreeNode
All Implemented Interfaces:
GraphNode<T>, TreeNode<T>
Direct Known Subclasses:
ImmutableBinaryTreeNode

public class ImmutableTreeNode<T extends TreeNode<T>>
extends ImmutableGraphNode<T>
implements TreeNode<T>

An ImmutableGraphNode specialization representing a tree node with a parent field linking back to the nodes (only) parent.


Constructor Summary
ImmutableTreeNode()
           
ImmutableTreeNode(java.util.List<T> children)
           
 
Method Summary
protected  void acquireChildren()
           
 T getParent()
          Returns the parent node or null if this node is the root.
 
Methods inherited from class org.parboiled.trees.ImmutableGraphNode
getChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.parboiled.trees.GraphNode
getChildren
 

Constructor Detail

ImmutableTreeNode

public ImmutableTreeNode()

ImmutableTreeNode

public ImmutableTreeNode(java.util.List<T> children)
Method Detail

getParent

public T getParent()
Description copied from interface: TreeNode
Returns the parent node or null if this node is the root.

Specified by:
getParent in interface TreeNode<T extends TreeNode<T>>
Returns:
the parent node

acquireChildren

protected void acquireChildren()