APIdia Launch Partner
Top Fields Constructors Methods
sun.jvm.hotspot.utilities

public Class RBTree

extends Object
Class Inheritance
Known Direct Subclasses
sun.jvm.hotspot.utilities.IntervalTree
Imports
java.io.PrintStream, java.util.Comparator, .Random

Field Summary

Modifier and TypeField and Description
private Comparator<Object>
protected static final boolean
protected static final boolean
private RBNode
protected static final boolean

Constructor Summary

AccessConstructor and Description
public
RBTree(Comparator<Object> comparator)

Method Summary

Modifier and TypeMethod and Description
private void
deleteFixup(RBNode x, RBNode xParent)

Restores red-black property to tree after splicing out node during deletion.

public void
deleteNode(RBNode z)

FIXME: this does not work properly yet for augmented red-black trees since it doesn't update nodes.

protected Object
public RBNode
public void
private boolean
leftRotate(RBNode x)

Returns true if updates must continue propagating up the tree

public static void
main(String[] args)

private void
printFromNode(RBNode node, PrintStream tty, int indentDepth)

Debugging

public void
private boolean
rightRotate(RBNode y)

Returns true if updates must continue propagating up the tree

private void
private RBNode
private RBNode
protected void
verify()

Verify invariants are preserved

private int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

comparatorback to summary
private Comparator<Object> comparator
DEBUGGINGback to summary
protected static final boolean DEBUGGING
REALLY_VERBOSEback to summary
protected static final boolean REALLY_VERBOSE
rootback to summary
private RBNode root
VERBOSEback to summary
protected static final boolean VERBOSE

Constructor Detail

RBTreeback to summary
public RBTree(Comparator<Object> comparator)

Method Detail

deleteFixupback to summary
private void deleteFixup(RBNode x, RBNode xParent)

Restores red-black property to tree after splicing out node during deletion. Note that x may be null, which is why xParent must be specified.

deleteNodeback to summary
public void deleteNode(RBNode z)

FIXME: this does not work properly yet for augmented red-black trees since it doesn't update nodes. Need to figure out exactly from which points we need to propagate updates upwards.

getNodeValueback to summary
protected Object getNodeValue(RBNode node)
getRootback to summary
public RBNode getRoot()
insertNodeback to summary
public void insertNode(RBNode x)
leftRotateback to summary
private boolean leftRotate(RBNode x)

Returns true if updates must continue propagating up the tree

mainback to summary
public static void main(String[] args)
printFromNodeback to summary
private void printFromNode(RBNode node, PrintStream tty, int indentDepth)

Debugging

printOnback to summary
public void printOn(PrintStream tty)
rightRotateback to summary
private boolean rightRotate(RBNode y)

Returns true if updates must continue propagating up the tree

treeInsertback to summary
private void treeInsert(RBNode z)
treeMinimumback to summary
private RBNode treeMinimum(RBNode x)
treeSuccessorback to summary
private RBNode treeSuccessor(RBNode x)
verifyback to summary
protected void verify()

Verify invariants are preserved

verifyFromNodeback to summary
private int verifyFromNode(RBNode node)