com.mhhe.clrs2e
Class DisjointSetForest.Node

java.lang.Object
  |
  +--com.mhhe.clrs2e.DisjointSetForest.Node
Enclosing class:
DisjointSetForest

private static class DisjointSetForest.Node
extends java.lang.Object

Private inner class to serve as opaque handles. Each node has a reference to its object. It also has a reference to its parent node and the value of its rank, made public so that they are accessible to the methods of DisjointSetForest.


Field Summary
 DisjointSetForest.Node p
          Reference to this node's parent.
 int rank
          This node's rank.
 java.lang.Object theObject
          Reference to the object.
 
Constructor Summary
DisjointSetForest.Node(java.lang.Object x)
          Makes a node for a given object.
 
Method Summary
 java.lang.String toString()
          Returns the String representation of this node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

theObject

public java.lang.Object theObject
Reference to the object.


p

public DisjointSetForest.Node p
Reference to this node's parent.


rank

public int rank
This node's rank.

Constructor Detail

DisjointSetForest.Node

public DisjointSetForest.Node(java.lang.Object x)
Makes a node for a given object.

Parameters:
x - The object in this node.
Method Detail

toString

public java.lang.String toString()
Returns the String representation of this node.

Overrides:
toString in class java.lang.Object