org.fhcrc.cpl.toolbox.datastructure
Class BinaryTreeNode<T>
java.lang.Object
org.fhcrc.cpl.toolbox.datastructure.TreeNode<T>
org.fhcrc.cpl.toolbox.datastructure.BinaryTreeNode<T>
public class BinaryTreeNode<T>
- extends TreeNode<T>
Binary tree node
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
leftChild
protected BinaryTreeNode leftChild
rightChild
protected BinaryTreeNode rightChild
BinaryTreeNode
public BinaryTreeNode()
addChild
public void addChild(TreeNode<T> child)
- Description copied from class:
TreeNode
- Adds a child to the list of children for this Node. The addition of
the first child will create a new List>.
- Overrides:
addChild in class TreeNode<T>
- Parameters:
child - a Node object to set.
insertChildAt
public void insertChildAt(int index,
TreeNode<T> child)
throws java.lang.IndexOutOfBoundsException
- Description copied from class:
TreeNode
- Inserts a Node at the specified position in the child list. Will * throw an ArrayIndexOutOfBoundsException if the index does not exist.
- Overrides:
insertChildAt in class TreeNode<T>
- Parameters:
index - the position to insert at.child - the Node object to insert.
- Throws:
java.lang.IndexOutOfBoundsException - if thrown.
setLeftChild
public void setLeftChild(TreeNode<T> newNode)
setRightChild
public void setRightChild(TreeNode<T> newNode)
hasLeftChild
public boolean hasLeftChild()
hasRightChild
public boolean hasRightChild()
getLeftChild
public BinaryTreeNode<T> getLeftChild()
getRightChild
public BinaryTreeNode<T> getRightChild()
Fred Hutchinson Cancer Research Center