uk.ac.sanger.psu.gfmerge.util.algotools._old
Class RBNode

java.lang.Object
  |
  +--uk.ac.sanger.psu.gfmerge.util.algotools._old.RBNode

public class RBNode
extends java.lang.Object

A node in a Red-Black tree

See Also:
RBTree

Field Summary
 RBNode leftChild
          This node's left child
 RBNode rightChild
          This node's right child
 
Constructor Summary
RBNode(long value)
          Create a red RBNode with the the specified value
 
Method Summary
 int compareValue(long value)
          Compares the specified value with the value of the node
 java.awt.Color getColour()
          Get the node's colour
 long getValue()
          Get the value stored in this node
 void setColour(java.awt.Color colour)
          Set the node's colour - ensures it is only red or black
 void setValue(long value)
          Set the value stored in this node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

leftChild

public RBNode leftChild
This node's left child


rightChild

public RBNode rightChild
This node's right child

Constructor Detail

RBNode

public RBNode(long value)
Create a red RBNode with the the specified value

Parameters:
value - The value of the newly created Node
Method Detail

getValue

public long getValue()
Get the value stored in this node


setValue

public void setValue(long value)
Set the value stored in this node

Parameters:
value - The value

compareValue

public int compareValue(long value)
Compares the specified value with the value of the node

Parameters:
value - The value to compare with the node's value
Returns:
-1 indicates that the specified value is less than the Node's value 1 indicates that the specified value is greater than the Node's value 0 indicates that the values are the same

getColour

public java.awt.Color getColour()
Get the node's colour


setColour

public void setColour(java.awt.Color colour)
Set the node's colour - ensures it is only red or black

Parameters:
colour - A Color representing the node's colour
See Also:
Color