Class BinaryTree.Node

java.lang.Object
  |
  +--BinaryTree.Node
Enclosing class:
BinaryTree

private class BinaryTree.Node
extends java.lang.Object

A binary tree node, where the associated data item is a generic Object.


Field Summary
private  BinaryTree.NodeReference mLeft
          Reference object for the left link
private  java.lang.Object mObj
          key/data object associated with this node
private  BinaryTree.NodeReference mRight
          Reference object for the right link
 
Constructor Summary
BinaryTree.Node(java.lang.Object obj)
          When a Node is created, it is constructed with a left and right reference object.
 
Method Summary
 BinaryTree.Node getLeft()
          get the Node on the left branch
 BinaryTree.NodeReference getLeftRef()
          get a reference to the left branch
 java.lang.Object getObj()
          get the Object associated with the Node
 BinaryTree.Node getRight()
          get the Node on the right branch
 BinaryTree.NodeReference getRightRef()
          get a reference to the right branch
private  void init()
          Initialize the left and right links
 void setLeft(BinaryTree.Node left)
          set the Node on the left branch
 void setRight(BinaryTree.Node right)
          set the Node on the right branch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mObj

private java.lang.Object mObj
key/data object associated with this node


mLeft

private BinaryTree.NodeReference mLeft
Reference object for the left link


mRight

private BinaryTree.NodeReference mRight
Reference object for the right link

Constructor Detail

BinaryTree.Node

public BinaryTree.Node(java.lang.Object obj)
When a Node is created, it is constructed with a left and right reference object. The left and right reference objects are unchangable, although what they point to can be changed (see setLeft() and setRight() below).

Method Detail

init

private void init()
Initialize the left and right links


getObj

public java.lang.Object getObj()
get the Object associated with the Node


getLeftRef

public BinaryTree.NodeReference getLeftRef()
get a reference to the left branch


getRightRef

public BinaryTree.NodeReference getRightRef()
get a reference to the right branch


getLeft

public BinaryTree.Node getLeft()
get the Node on the left branch


setLeft

public void setLeft(BinaryTree.Node left)
set the Node on the left branch


getRight

public BinaryTree.Node getRight()
get the Node on the right branch


setRight

public void setRight(BinaryTree.Node right)
set the Node on the right branch