@StoreNotUseStandardSerialization @StorableClass public class RBTSentinel<E> extends Object implements IRBTNode<E>, Serializable
| Constructor and Description |
|---|
RBTSentinel() |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(IRBTVisitor<E> visitor)
accept red black tree visitor
|
int |
compareTo(E element) |
int |
compareTo(IRBTComparableNode<E> node) |
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
|
static RBTSentinel |
newInstance(IInstanceFactory instanceFactory) |
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
|
String |
toString() |
public static RBTSentinel newInstance(IInstanceFactory instanceFactory)
public boolean isColorSetted()
isColorSetted in interface IRBTNode<E>public boolean isBlack()
throws RBTException
IRBTNodeisBlack in interface IRBTNode<E>RBTException - node access errorpublic void setBlack()
IRBTNodepublic boolean isRed()
throws RBTException
IRBTNodeisRed in interface IRBTNode<E>RBTException - node access errorpublic void setRed()
IRBTNodepublic IRBTNode<E> getParent() throws RBTException
IRBTNodegetParent in interface IRBTNode<E>RBTException - node access errorpublic void setParent(IRBTNode<E> node)
IRBTNodepublic IRBTNode<E> getLeft() throws RBTException
IRBTNodegetLeft in interface IRBTNode<E>RBTException - node access errorpublic void setLeft(IRBTNode<E> node) throws RBTException
IRBTNodesetLeft in interface IRBTNode<E>node - the left child of this nodeRBTException - node access errorpublic IRBTNode<E> getRight() throws RBTException
IRBTNodegetRight in interface IRBTNode<E>RBTException - node access errorpublic void setRight(IRBTNode<E> node) throws RBTException
IRBTNodesetRight in interface IRBTNode<E>node - the right child of this nodeRBTException - node access errorpublic int compareTo(IRBTComparableNode<E> node)
compareTo in interface IRBTComparableNode<E>public int compareTo(E element) throws RBTException
compareTo in interface IRBTComparableNode<E>RBTExceptionpublic boolean isSentinel()
throws RBTException
IRBTNodeisSentinel in interface IRBTNode<E>RBTException - node access errorpublic boolean getColor()
throws RBTException
IRBTNodeRedBlackTree#BLACK and RedBlackTree#REDgetColor in interface IRBTNode<E>RBTException - node access errorpublic void setColor(boolean color)
IRBTNodeRedBlackTree#BLACK and RedBlackTree#REDpublic void accept(IRBTVisitor<E> visitor) throws RBTException
IRBTVisitableaccept in interface IRBTVisitable<E>visitor - the red black tree visitorRBTException - node access errorpublic int getNumberOfChild()
IRBTNodegetNumberOfChild in interface IRBTNode<E>public void setNumberOfChild(int numberOfChild)
IRBTNodesetNumberOfChild in interface IRBTNode<E>numberOfChild - the number of childrenpublic void decrementNumberOfChild()
throws RBTException
decrementNumberOfChild in interface IRBTNode<E>RBTExceptionpublic void incrementNumberOfChild()
throws RBTException
incrementNumberOfChild in interface IRBTNode<E>RBTExceptionpublic E getElement()
IRBTNodegetElement in interface IRBTNode<E>public void setElement(E element)
IRBTNodesetElement in interface IRBTNode<E>element - the element to set for this nodepublic void detach()
IRBTNodepublic boolean isAttached()
isAttached in interface IRBTNode<E>Copyright © 2007-2012 Luc Peuvrier. All Rights Reserved.