com.mhhe.clrs2e
Class RedBlackTree.Node

java.lang.Object
  |
  +--com.mhhe.clrs2e.BinarySearchTree.Node
        |
        +--com.mhhe.clrs2e.RedBlackTree.Node
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
IntervalTree.Node, OrderStatisticTree.Node
Enclosing class:
RedBlackTree

protected class RedBlackTree.Node
extends BinarySearchTree.Node

Inner class for a red-black tree node. Extends a binary search tree node with an additional color field.


Field Summary
protected  java.awt.Color color
          The node's color, either RED or BLACK.
 
Fields inherited from class com.mhhe.clrs2e.BinarySearchTree.Node
data, left, parent, right
 
Constructor Summary
RedBlackTree.Node(java.lang.Comparable data)
          Initializes a node with the data, makes other pointers nil, and makes the node red.
 
Method Summary
 java.lang.String toString()
          Returns the data instance variable of this node and this node's color as a String.
 
Methods inherited from class com.mhhe.clrs2e.BinarySearchTree.Node
compareTo, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

color

protected java.awt.Color color
The node's color, either RED or BLACK.

Constructor Detail

RedBlackTree.Node

public RedBlackTree.Node(java.lang.Comparable data)
Initializes a node with the data, makes other pointers nil, and makes the node red.

Parameters:
data - Data to save in the node.
Method Detail

toString

public java.lang.String toString()
Returns the data instance variable of this node and this node's color as a String.

Overrides:
toString in class BinarySearchTree.Node