|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.ac.sanger.psu.gfmerge.util.algotools._old.RBTree
A Red-Black tree
Constructor Summary | |
RBTree()
Constructs an empty Red-Black tree |
Method Summary | |
void |
ClearTree()
Clear the tree of all nodes |
void |
drawRBTree(java.awt.Graphics g,
int width,
int height)
Draws the Red-Black tree to the screen Calls DrawNode on the root, which then recalls that method many times - one for each nodein the tree. |
boolean |
isEmpty()
Is tree empty? |
RBNode |
RBDoubleRotateLeft(RBNode current)
The current node is made the left child of the right child, the right child is made the right child of its own left child, which in turn is made the current node. |
int |
RBInsert(long value)
Insert a new Node with the specified value making sure that the Red-Black properties are preserved If the root node is null then this method inserts it, otherwise it calls the RecursiveInsert method to traverse the tree looking for the insertion point |
void |
setStatus(int status)
Sets the current status of the tree |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RBTree()
Method Detail |
public void ClearTree()
public void setStatus(int status)
public int RBInsert(long value)
value
- The value of the node to be inserted
public RBNode RBDoubleRotateLeft(RBNode current)
current
- The current node
public boolean isEmpty()
public void drawRBTree(java.awt.Graphics g, int width, int height)
g
- The Graphics objectwidth
- The Applet's widthheight
- The Applet's height
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |