datastructures

net.datastructures
Class BTNode

java.lang.Object
  extended bynet.datastructures.BTNode
All Implemented Interfaces:
BTPosition, Position
Direct Known Subclasses:
AVLTree.AVLNode, RBTree.RBNode

public class BTNode
extends Object
implements BTPosition

Class implementing a node of a binary tree by storing references to an element, a parent node, a left node, and a right node.

Author:
Luca Vismara, Roberto Tamassia, Michael Goodrich

Constructor Summary
BTNode()
          Default constructor
BTNode(Object element, BTPosition parent, BTPosition left, BTPosition right)
          Main constructor
 
Method Summary
 Object element()
          Returns the element stored at this position.
 BTPosition getLeft()
           
 BTPosition getParent()
           
 BTPosition getRight()
           
 void setElement(Object o)
           
 void setLeft(BTPosition v)
           
 void setParent(BTPosition v)
           
 void setRight(BTPosition v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BTNode

public BTNode()
Default constructor


BTNode

public BTNode(Object element,
              BTPosition parent,
              BTPosition left,
              BTPosition right)
Main constructor

Method Detail

element

public Object element()
Description copied from interface: Position
Returns the element stored at this position.

Specified by:
element in interface Position

setElement

public void setElement(Object o)
Specified by:
setElement in interface BTPosition

getLeft

public BTPosition getLeft()
Specified by:
getLeft in interface BTPosition

setLeft

public void setLeft(BTPosition v)
Specified by:
setLeft in interface BTPosition

getRight

public BTPosition getRight()
Specified by:
getRight in interface BTPosition

setRight

public void setRight(BTPosition v)
Specified by:
setRight in interface BTPosition

getParent

public BTPosition getParent()
Specified by:
getParent in interface BTPosition

setParent

public void setParent(BTPosition v)
Specified by:
setParent in interface BTPosition

datastructures