Class MutableBinaryTreeNodeImpl<T extends MutableBinaryTreeNode<T>>
java.lang.Object
org.parboiled.trees.MutableTreeNodeImpl<T>
org.parboiled.trees.MutableBinaryTreeNodeImpl<T>
- Type Parameters:
T- the actual implementation type of this MutableBinaryTreeNodeImpl
- All Implemented Interfaces:
BinaryTreeNode<T>, GraphNode<T>, MutableTreeNode<T>, TreeNode<T>
public class MutableBinaryTreeNodeImpl<T extends MutableBinaryTreeNode<T>>
extends MutableTreeNodeImpl<T>
implements BinaryTreeNode<T>
A simple
MutableBinaryTreeNode implementation based on the MutableTreeNodeImpl.-
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.left()Returns the left sub node.removeChild(int index) Removes the child with the given index.right()Returns the right sub node.voidvoidMethods inherited from class MutableTreeNodeImpl
getChildren, getParent, setChildMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface GraphNode
getChildren
-
Constructor Details
-
MutableBinaryTreeNodeImpl
public MutableBinaryTreeNodeImpl()
-
-
Method Details
-
left
Description copied from interface:BinaryTreeNodeReturns the left sub node.- Specified by:
leftin interfaceBinaryTreeNode<T extends MutableBinaryTreeNode<T>>- Returns:
- the left sub node
-
setLeft
-
right
Description copied from interface:BinaryTreeNodeReturns the right sub node.- Specified by:
rightin interfaceBinaryTreeNode<T extends MutableBinaryTreeNode<T>>- Returns:
- the right sub node
-
setRight
-
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 MutableBinaryTreeNode<T>>- Overrides:
addChildin classMutableTreeNodeImpl<T extends MutableBinaryTreeNode<T>>- Parameters:
index- the index under which to insert this child into the children listchild- the child node to add
-
removeChild
Description copied from interface:MutableTreeNodeRemoves the child with the given index.- Specified by:
removeChildin interfaceMutableTreeNode<T extends MutableBinaryTreeNode<T>>- Overrides:
removeChildin classMutableTreeNodeImpl<T extends MutableBinaryTreeNode<T>>- Parameters:
index- the index of the child to remove.- Returns:
- the removed child
-