public interface IRBTNode<E> extends IRBTComparableNode<E>, IRBTVisitable<E>
RedBlackTree#BLACK
and RedBlackTree#RED
Object.equals(Object)
and Object.hashCode()
Modifier and Type | Method and Description |
---|---|
void |
decrementNumberOfChild() |
void |
detach()
detach the node from the tree
|
boolean |
getColor()
get node color
color definition: RedBlackTree#BLACK and RedBlackTree#RED |
E |
getElement()
get the element of this node
|
int |
getIndex() |
IRBTNode<E> |
getLeft()
get left child of this node
|
int |
getNumberOfChild()
get the number of node in right and left tree node, sentinel excluded
|
IRBTNode<E> |
getParent()
get parent node
|
IRBTNode<E> |
getRight()
get right child of this node
|
void |
incrementNumberOfChild() |
boolean |
isAttached() |
boolean |
isBlack()
to know if node is black
|
boolean |
isColorSetted() |
boolean |
isRed()
to know if node is red
|
boolean |
isSentinel()
to know if this node is a sentinel ( a black leaf marker ), if not a
sentinel it is a valued node with right and left child
|
void |
setBlack()
set node color to black
|
void |
setColor(boolean color)
set node color
color definition: RedBlackTree#BLACK and RedBlackTree#RED |
void |
setElement(E element)
set this node element
|
void |
setIndex(int index) |
void |
setLeft(IRBTNode<E> node)
set left child of this node
|
void |
setNumberOfChild(int numberOfChild)
set the number of node in right and left tree node, sentinel excluded
|
void |
setParent(IRBTNode<E> node)
set parent node
|
void |
setRed()
set node color to red
|
void |
setRight(IRBTNode<E> node)
set right child of this node
|
compareTo, compareTo
accept
boolean isColorSetted() throws RBTException
RBTException
boolean isBlack() throws RBTException
RBTException
- node access errorvoid setBlack() throws RBTException
RBTException
boolean isRed() throws RBTException
RBTException
- node access errorvoid setRed() throws RBTException
RBTException
- node access errorboolean getColor() throws RBTException
RedBlackTree#BLACK
and RedBlackTree#RED
RBTException
- node access errorvoid setColor(boolean color) throws RBTException
RedBlackTree#BLACK
and RedBlackTree#RED
color
- the node colorRBTException
- node access errorIRBTNode<E> getParent() throws RBTException
RBTException
- node access errorvoid setParent(IRBTNode<E> node) throws RBTException
node
- the parent nodeRBTException
- node access errorIRBTNode<E> getLeft() throws RBTException
RBTException
- node access errorvoid setLeft(IRBTNode<E> node) throws RBTException
node
- the left child of this nodeRBTException
- node access errorIRBTNode<E> getRight() throws RBTException
RBTException
- node access errorvoid setRight(IRBTNode<E> node) throws RBTException
node
- the right child of this nodeRBTException
- node access errorboolean isSentinel() throws RBTException
RBTException
- node access errorint getNumberOfChild() throws RBTException
RBTException
- node access errorvoid setNumberOfChild(int numberOfChild) throws RBTException
numberOfChild
- the number of childrenRBTException
void setIndex(int index)
int getIndex()
void setElement(E element) throws RBTException
element
- the element to set for this nodeRBTException
IllegalArgumentException
- element is nullE getElement() throws RBTException
RBTException
void detach()
boolean isAttached()
void incrementNumberOfChild() throws RBTException
RBTException
void decrementNumberOfChild() throws RBTException
RBTException
Copyright © 2007-2012 Luc Peuvrier. All Rights Reserved.