Main Page | Compound List | File List | Compound Members

BinaryTree.Node Class Reference

List of all members.

Detailed Description

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


Public Member Functions

 Node (Object obj)
 When a Node is created, it is constructed with a left and right reference object.

Object getObj ()
 get the Object associated with the Node

NodeReference getLeftRef ()
 get a reference to the left branch

NodeReference getRightRef ()
 get a reference to the right branch

Node getLeft ()
 get the Node on the left branch

void setLeft (Node left)
 set the Node on the left branch

Node getRight ()
 get the Node on the right branch

void setRight (Node right)
 set the Node on the right branch


Private Member Functions

void init ()
 Initialize the left and right links.


Private Attributes

Object mObj
 key/data object associated with this node

NodeReference mLeft
 Reference object for the left link.

NodeReference mRight
 Reference object for the right link.


Constructor & Destructor Documentation

BinaryTree.Node.Node 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).

00131                                   { 
00132             mObj = obj; 
00133             init();
00134         }


Member Function Documentation

Node BinaryTree.Node.getLeft  ) 
 

get the Node on the left branch

00145 { return mLeft.ref; }

NodeReference BinaryTree.Node.getLeftRef  ) 
 

get a reference to the left branch

00140 { return mLeft; }

Object BinaryTree.Node.getObj  ) 
 

get the Object associated with the Node

00137 { return mObj; }

Node BinaryTree.Node.getRight  ) 
 

get the Node on the right branch

00150 { return mRight.ref; }

NodeReference BinaryTree.Node.getRightRef  ) 
 

get a reference to the right branch

00142 { return mRight; }

void BinaryTree.Node.init  )  [private]
 

Initialize the left and right links.

00119         {
00120             mLeft = new NodeReference();
00121             mRight = new NodeReference();
00122         }

void BinaryTree.Node.setLeft Node  left  ) 
 

set the Node on the left branch

00147 { mLeft.ref = left; }

void BinaryTree.Node.setRight Node  right  ) 
 

set the Node on the right branch

00152 { mRight.ref = right; }


Member Data Documentation

NodeReference BinaryTree.Node.mLeft [private]
 

Reference object for the left link.

Object BinaryTree.Node.mObj [private]
 

key/data object associated with this node

NodeReference BinaryTree.Node.mRight [private]
 

Reference object for the right link.


The documentation for this class was generated from the following file:
Generated on Mon Sep 1 20:49:25 2003 for BinaryTree by doxygen 1.3.3