public class RBTNode<T extends Comparable> extends Object
Modifier and Type | Field and Description |
---|---|
T |
data
The satellite data in the node.
|
protected boolean |
isRed
The color node of current node.
|
protected RBTNode<T> |
left
The left child node of current node.
|
protected RBTNode<T> |
p
The parent node of current node.
|
protected RBTNode<T> |
right
The right child node of current node.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isBlack()
color of the node to black.
|
RBTNode<T> |
left()
Returns the left child of the node.
|
void |
leftTo(RBTNode<T> l)
Sets the left child node to parent.
|
T |
object()
Returns the satellite data of the node.
|
void |
objectTo(T o)
Sets the data to o.
|
RBTNode<T> |
parent()
Returns the parent of the node.
|
void |
parentTo(RBTNode<T> parent)
Sets the parent node to parent.
|
RBTNode<T> |
right()
Returns the right child of the node.
|
void |
rightTo(RBTNode<T> r)
Sets the right child node to parent.
|
void |
setBlack()
Sets the color of the node to black.
|
void |
setRed()
Sets the color of the node to red.
|
String |
toString()
Returns the node as a
String . |
public T extends Comparable data
protected boolean isRed
setBlack()
,
setRed()
protected RBTNode<T extends Comparable> p
parent()
,
parentTo(cnslab.cnsmath.RBTNode<T>)
protected RBTNode<T extends Comparable> left
left()
,
leftTo(cnslab.cnsmath.RBTNode<T>)
protected RBTNode<T extends Comparable> right
right()
,
rightTo(cnslab.cnsmath.RBTNode<T>)
public T object()
public RBTNode<T> right()
public RBTNode<T> left()
public void setBlack()
public boolean isBlack()
public void setRed()
public void parentTo(RBTNode<T> parent)
parent
- The new parent node of the node.public void rightTo(RBTNode<T> r)
r
- The new right child node of the node.