infovis.utils
Class RBTree

java.lang.Object
  extended by cern.colt.PersistentObject
      extended by cern.colt.map.AbstractMap
          extended by cern.colt.map.AbstractIntIntMap
              extended by infovis.utils.RBTree
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
IntIntSortedMap

public class RBTree
extends AbstractIntIntMap
implements Cloneable, Serializable

Red-Black Tree

Version:
$Revision: 1.8 $
Author:
Jean-Daniel Fekete
See Also:
Serialized Form

Nested Class Summary
 class RBTree.KeyIterator
           
static class RBTree.RBNode
           
 class RBTree.RBNodeIterator
           
 
Field Summary
static boolean BLACK
           
static RBTree.RBNode NIL
           
static boolean RED
           
 
Fields inherited from class cern.colt.PersistentObject
serialVersionUID
 
Constructor Summary
RBTree()
           
RBTree(IntComparator comp)
           
RBTree(RBTree other)
           
 
Method Summary
 void clear()
           
 Object clone()
           
 int compare(int key1, int key2)
           
 boolean containsKey(int key)
           
 int firstKey()
           
 boolean forEachKey(IntProcedure proc)
           
 boolean forEachPair(IntIntProcedure proc)
           
 int get(int key)
           
 IntComparator getComparator()
           
 boolean isEmpty()
          Report whether this tree has no elements.
static boolean isNull(RBTree.RBNode node)
           
 RowIterator keyIterator()
           
 RowIterator keyIterator(int key)
           
 int lastKey()
           
 RBTree.RBNodeIterator nodeIterator()
           
 boolean put(int key, int value)
           
 int remove(int key)
           
 boolean removeKey(int key)
           
 int size()
          Report the number of elements in the tree.
 RowIterator valueIterator()
           
 
Methods inherited from class cern.colt.map.AbstractIntIntMap
containsValue, copy, equals, keyOf, keys, keys, keysSortedByValue, pairsMatching, pairsSortedByKey, pairsSortedByValue, toString, toStringByValue, values, values
 
Methods inherited from class cern.colt.map.AbstractMap
ensureCapacity, trimToSize
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RED

public static final boolean RED
See Also:
Constant Field Values

BLACK

public static final boolean BLACK
See Also:
Constant Field Values

NIL

public static final RBTree.RBNode NIL
Constructor Detail

RBTree

public RBTree()

RBTree

public RBTree(RBTree other)

RBTree

public RBTree(IntComparator comp)
Method Detail

clone

public Object clone()
Overrides:
clone in class PersistentObject

forEachKey

public boolean forEachKey(IntProcedure proc)
Specified by:
forEachKey in class AbstractIntIntMap

forEachPair

public boolean forEachPair(IntIntProcedure proc)
Overrides:
forEachPair in class AbstractIntIntMap

removeKey

public boolean removeKey(int key)
Specified by:
removeKey in class AbstractIntIntMap

compare

public int compare(int key1,
                   int key2)

size

public int size()
Report the number of elements in the tree.

Overrides:
size in class AbstractMap
Returns:
the number of elements

isEmpty

public boolean isEmpty()
Report whether this tree has no elements.

Overrides:
isEmpty in class AbstractMap
Returns:
true if size() == 0

containsKey

public boolean containsKey(int key)
Overrides:
containsKey in class AbstractIntIntMap

get

public int get(int key)
Specified by:
get in class AbstractIntIntMap

put

public boolean put(int key,
                   int value)
Specified by:
put in class AbstractIntIntMap

remove

public int remove(int key)

clear

public void clear()
Specified by:
clear in class AbstractMap

firstKey

public int firstKey()

lastKey

public int lastKey()

nodeIterator

public RBTree.RBNodeIterator nodeIterator()

keyIterator

public RowIterator keyIterator()

keyIterator

public RowIterator keyIterator(int key)

valueIterator

public RowIterator valueIterator()

getComparator

public IntComparator getComparator()

isNull

public static boolean isNull(RBTree.RBNode node)


Copyright © 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.