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

public Class RBNode

extends Object
Class Inheritance
Known Direct Subclasses
sun.jvm.hotspot.utilities.IntervalNode

This class implements a node in a red-black tree. It provides accessors for the left and right children as well as the color of the node.

Field Summary

Modifier and TypeField and Description
private RBColor
private Object
private RBNode
private RBNode
private RBNode

Constructor Summary

AccessConstructor and Description
public
RBNode(Object data)

Newly-created nodes are colored red

Method Summary

Modifier and TypeMethod and Description
public void
copyFrom(RBNode arg)

Must copy all user-defined fields from the given node.

public RBColor
public Object
public RBNode
getLeft()

Access to left child

public RBNode
public RBNode
getRight()

Access to right child

public void
public void
public void
setParent(RBNode parent)

public void
public boolean
update()

This is called by the base RBTree's insertion and deletion methods when necessary.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

colorback to summary
private RBColor color
databack to summary
private Object data
leftback to summary
private RBNode left
parentback to summary
private RBNode parent

Constructor Detail

RBNodeback to summary
public RBNode(Object data)

Newly-created nodes are colored red

Method Detail

copyFromback to summary
public void copyFrom(RBNode arg)

Must copy all user-defined fields from the given node. For example, the base implementation copies the "data" field. However, it does not (and must not) copy the link fields (parent, left child, right child). It also does not need to copy any computed information for the node, as the node will be updated when necessary. Subclasses must be careful to call the superclass implementation.

getColorback to summary
public RBColor getColor()
getDataback to summary
public Object getData()
getLeftback to summary
public RBNode getLeft()

Access to left child

getParentback to summary
public RBNode getParent()
getRightback to summary
public RBNode getRight()

Access to right child

setColorback to summary
public void setColor(RBColor color)
setLeftback to summary
public void setLeft(RBNode left)
setParentback to summary
public void setParent(RBNode parent)
setRightback to summary
public void setRight(RBNode right)
updateback to summary
public boolean update()

This is called by the base RBTree's insertion and deletion methods when necessary. Subclasses can use this to update any computed information based on the information in their left or right children. For multi-node updates it is guaranteed that this method will be called in the correct order. This should return true if an update actually occurred, false if not.