jdsl
Class SimpleRBTree

java.lang.Object
  |
  +--jdsl.SimpleBinarySearchTree
        |
        +--jdsl.SimpleRBTree

public class SimpleRBTree
extends SimpleBinarySearchTree
implements SimpleDictionary


Fields inherited from class jdsl.SimpleBinarySearchTree
actionPos
 
Constructor Summary
SimpleRBTree(Comparator C)
           
 
Method Summary
 BinaryTree getBinaryTree()
           
protected  boolean hasRedChild(Position position)
           
 void insertItem(java.lang.Object key, java.lang.Object element)
           
protected  boolean isPosRed(Position position)
           
 Container newContainer()
          Make a new container of this type using the same comparator
protected  Position redChild(Position position)
           
protected  void remedyDoubleBlack(Position posR)
           
protected  void remedyDoubleRed(Position posZ)
           
 java.lang.Object remove(java.lang.Object key)
           
protected  void setBlack(Position position)
           
protected  void setColor(Position position, boolean color)
           
protected  void setRed(Position position)
           
protected  void swap(Position swapPos, Position remPos)
           
protected  boolean swapColor(Position a, Position b)
           
 
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
 

Constructor Detail

SimpleRBTree

public SimpleRBTree(Comparator C)
Method Detail

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