Class MutableTreeNodeImpl<T extends MutableTreeNode<T>>
java.lang.Object
org.parboiled.trees.MutableTreeNodeImpl<T>
- Type Parameters:
T- the actual implementation type of this MutableTreeNodeImpl
- All Implemented Interfaces:
GraphNode<T>, MutableTreeNode<T>, TreeNode<T>
- Direct Known Subclasses:
MutableBinaryTreeNodeImpl
public class MutableTreeNodeImpl<T extends MutableTreeNode<T>>
extends Object
implements MutableTreeNode<T>
A base implementation of the
MutableTreeNode.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the given child to this nodes children list and setting the childs parent field to this node.Returns the sub nodes of this node.Returns the parent node or null if this node is the root.removeChild(int index) Removes the child with the given index.voidSets the child node at the given index to the given node.
-
Constructor Details
-
MutableTreeNodeImpl
public MutableTreeNodeImpl()
-
-
Method Details
-
getParent
-
getChildren
Description copied from interface:GraphNodeReturns the sub nodes of this node.- Specified by:
getChildrenin interfaceGraphNode<T extends MutableTreeNode<T>>- Returns:
- the sub nodes
-
addChild
Description copied from interface:MutableTreeNodeAdds the given child to this nodes children list and setting the childs parent field to this node. If the child is currently attached to another node it is first removed.- Specified by:
addChildin interfaceMutableTreeNode<T extends MutableTreeNode<T>>- Parameters:
index- the index under which to insert this child into the children listchild- the child node to add
-
setChild
Description copied from interface:MutableTreeNodeSets the child node at the given index to the given node. The node previously existing at the given child index is first properly removed by setting its parent field to null. If the child is currently attached to another node it is first removed from its old parent.- Specified by:
setChildin interfaceMutableTreeNode<T extends MutableTreeNode<T>>- Parameters:
index- the index under which to set this child into the children listchild- the child node to set
-
removeChild
Description copied from interface:MutableTreeNodeRemoves the child with the given index.- Specified by:
removeChildin interfaceMutableTreeNode<T extends MutableTreeNode<T>>- Parameters:
index- the index of the child to remove.- Returns:
- the removed child
-