Fairness.Trees
Class SimpleTreeManager

java.lang.Object
  extended by Fairness.Trees.TreeManager
      extended by Fairness.Trees.SimpleTreeManager

public class SimpleTreeManager
extends TreeManager

SimpleTreeManager is a simple tree manager which is used for testing and debugging purposes. It takes only a single stripe and a child thus forming a chain of single striped nodes.


Field Summary
 
Fields inherited from class Fairness.Trees.TreeManager
sim
 
Constructor Summary
SimpleTreeManager()
           
 
Method Summary
 int getNextNodeId()
          Returns the next node ID using the node ID allocation algorithm from this TreeManager.
 java.util.Collection<Node> getRootNodes()
          After a tree reconstruction, returns the nodes that are the roots of their stripe trees.
 void rebuildTree()
          A method to completely rebuild the Node tree given all nodes in the system.
protected  void setUp()
          Called when the public setup method is called.
 
Methods inherited from class Fairness.Trees.TreeManager
addNode, forestToString, getAllNodes, setUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTreeManager

public SimpleTreeManager()
Method Detail

setUp

protected void setUp()
Description copied from class: TreeManager
Called when the public setup method is called. At this time, the sim parameter has been initialized, and getAllNodes also should be valid to call.

Overrides:
setUp in class TreeManager

getRootNodes

public java.util.Collection<Node> getRootNodes()
Description copied from class: TreeManager
After a tree reconstruction, returns the nodes that are the roots of their stripe trees. It is assumed that the Node is the root of its primary stripe and of no other. That is, Node getParent( getStripeId() ) should return null.

Specified by:
getRootNodes in class TreeManager
Returns:
non-null Collection of 0 or more Node.

rebuildTree

public void rebuildTree()
Description copied from class: TreeManager
A method to completely rebuild the Node tree given all nodes in the system.

Specified by:
rebuildTree in class TreeManager

getNextNodeId

public int getNextNodeId()
Description copied from class: TreeManager
Returns the next node ID using the node ID allocation algorithm from this TreeManager.

Specified by:
getNextNodeId in class TreeManager