public static class RedBlackTree.Node<T> extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RedBlackTree.Node.NodeColor
The domain of values from which a node's color is assigned.
|
| Constructor and Description |
|---|
Node(T value)
Construct a new node with the specified value.
|
| Modifier and Type | Method and Description |
|---|---|
RedBlackTree.Node.NodeColor |
getColor()
Get the color.
|
RedBlackTree.Node<T> |
getLeft()
Get the left child.
|
RedBlackTree.Node<T> |
getParent()
Get the parent.
|
RedBlackTree.Node<T> |
getRight()
Get the right child.
|
T |
getValue()
Get the value.
|
boolean |
isLeaf()
Test whether or not this node is a leaf node.
|
protected void |
setColor(RedBlackTree.Node.NodeColor color)
Set the color.
|
protected void |
setLeft(RedBlackTree.Node<T> node)
Set the left child.
|
protected void |
setParent(RedBlackTree.Node<T> node)
Set the parent.
|
protected void |
setRight(RedBlackTree.Node<T> node)
Set the right child.
|
protected void |
setValue(T value)
Set the value.
|
public Node(T value)
value - the value to store in this node.public RedBlackTree.Node.NodeColor getColor()
public RedBlackTree.Node<T> getLeft()
public RedBlackTree.Node<T> getParent()
public RedBlackTree.Node<T> getRight()
public T getValue()
public boolean isLeaf()
protected void setColor(RedBlackTree.Node.NodeColor color)
color - the color to set to this node.protected void setLeft(RedBlackTree.Node<T> node)
node - the node to set as the left child of this node.protected void setParent(RedBlackTree.Node<T> node)
node - the node to set as the parent of this node.protected void setRight(RedBlackTree.Node<T> node)
node - the node to set as the right child of this node.protected void setValue(T value)
value - the value to store in this node, must be non-null.Copyright © 1994–2024 Peter Murray-Rust. All rights reserved.