Class TreeNode<T>

java.lang.Object
  extended by TreeNode<T>

public class TreeNode<T>
extends java.lang.Object


Constructor Summary
TreeNode(T newItem)
          Constructor for a TreeNode.
TreeNode(T newItem, TreeNode<T> left, TreeNode<T> right)
          Constructor for a TreeNode.
 
Method Summary
 T getItem()
          Getter for the data item contained in this TreeNode
 TreeNode<T> getLeftChild()
          Getter for the left child of this TreeNode
 TreeNode<T> getRightChild()
          Getter for the right child of this TreeNode
 void setItem(T item)
          Setter for the data item contained in this TreeNode
 void setLeftChild(TreeNode<T> leftChild)
          Setter for left child of this TreeNode
 void setRightChild(TreeNode<T> rightChild)
          Setter for right child of this TreeNode
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeNode

public TreeNode(T newItem)
Constructor for a TreeNode.

Parameters:
newItem - The data item to be contained in this TreeNode

TreeNode

public TreeNode(T newItem,
                TreeNode<T> left,
                TreeNode<T> right)
Constructor for a TreeNode.

Parameters:
newItem - The data item to be contained in this TreeNode
left - The left child of this TreeNode
right - The right child of this TreeNode
Method Detail

getItem

public T getItem()
Getter for the data item contained in this TreeNode

Returns:
Returns the data item contained in this TreeNode

setItem

public void setItem(T item)
Setter for the data item contained in this TreeNode

Parameters:
item - The data item to be contained in this TreeNode

getLeftChild

public TreeNode<T> getLeftChild()
Getter for the left child of this TreeNode

Returns:
Returns a reference to the left child of this TreeNode

setLeftChild

public void setLeftChild(TreeNode<T> leftChild)
Setter for left child of this TreeNode

Parameters:
leftChild - The left child of this TreeNode

getRightChild

public TreeNode<T> getRightChild()
Getter for the right child of this TreeNode

Returns:
Returns a reference to the right child of this TreeNode

setRightChild

public void setRightChild(TreeNode<T> rightChild)
Setter for right child of this TreeNode

Parameters:
rightChild - The right child of this TreeNode