jdsl
Class SimpleRBTree
java.lang.Object
|
+--jdsl.SimpleBinarySearchTree
|
+--jdsl.SimpleRBTree
- public class SimpleRBTree
- extends SimpleBinarySearchTree
- implements SimpleDictionary
| Methods inherited from class jdsl.SimpleBinarySearchTree |
checkKey,
element,
elements,
findAllArrayListIter,
findAllElements,
findElement,
findPosition,
isEmpty,
key,
keys,
removeAll,
size |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
SimpleRBTree
public SimpleRBTree(Comparator C)
insertItem
public void insertItem(java.lang.Object key,
java.lang.Object element)
throws InvalidKeyException
- Specified by:
- insertItem in interface SimpleDictionary
- Overrides:
- insertItem in class SimpleBinarySearchTree
remedyDoubleRed
protected void remedyDoubleRed(Position posZ)
remove
public java.lang.Object remove(java.lang.Object key)
- Specified by:
- remove in interface SimpleDictionary
- Overrides:
- remove in class SimpleBinarySearchTree
remedyDoubleBlack
protected void remedyDoubleBlack(Position posR)
isPosRed
protected boolean isPosRed(Position position)
setRed
protected void setRed(Position position)
setBlack
protected void setBlack(Position position)
setColor
protected void setColor(Position position,
boolean color)
redChild
protected Position redChild(Position position)
hasRedChild
protected boolean hasRedChild(Position position)
getBinaryTree
public BinaryTree getBinaryTree()
swapColor
protected boolean swapColor(Position a,
Position b)
swap
protected void swap(Position swapPos,
Position remPos)
- Overrides:
- swap in class SimpleBinarySearchTree
newContainer
public Container newContainer()
- Make a new container of this type using the same comparator
- Overrides:
- newContainer in class SimpleBinarySearchTree