All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class collections.RBPair

java.lang.Object
   |
   +----collections.Cell
           |
           +----collections.RBCell
                   |
                   +----collections.RBPair

public class RBPair
extends RBCell
implements Pair
RBPairs are RBCells with keys.


Constructor Index

 o RBPair(Object, Object)
Make a cell with given key and element values, and null links

Method Index

 o clone()
Make a new node with same key and element values, but null links
 o count(Object, Comparator)
Implements RBCell.count.
 o count(Object, Object, Comparator)
return number of nodes of subtree holding (key, element)
 o countKey(Object, Comparator)
return number of nodes of subtree holding key
 o find(Object, Comparator)
Implements RBCell.find.
 o find(Object, Object, Comparator)
find and return a cell holding (key, element), or null if no such
 o findKey(Object, Comparator)
find and return a cell holding key, or null if no such
 o key()
return the key
 o key(Object)
set the key

Constructors

 o RBPair
 public RBPair(Object k,
               Object v)
Make a cell with given key and element values, and null links

Methods

 o clone
 protected Object clone() throws CloneNotSupportedException
Make a new node with same key and element values, but null links

Overrides:
clone in class RBCell
 o key
 public final Object key()
return the key

 o key
 public final void key(Object k)
set the key

 o find
 public RBCell find(Object element,
                    Comparator cmp)
Implements RBCell.find. Override RBCell version since we are ordered on keys, not elements, so element find has to search whole tree. comparator argument not actually used.

Overrides:
find in class RBCell
See Also:
find
 o count
 public int count(Object element,
                  Comparator cmp)
Implements RBCell.count.

Overrides:
count in class RBCell
See Also:
count
 o findKey
 public RBPair findKey(Object key,
                       Comparator cmp)
find and return a cell holding key, or null if no such

 o find
 public RBPair find(Object key,
                    Object element,
                    Comparator cmp)
find and return a cell holding (key, element), or null if no such

 o countKey
 public int countKey(Object key,
                     Comparator cmp)
return number of nodes of subtree holding key

 o count
 public int count(Object key,
                  Object element,
                  Comparator cmp)
return number of nodes of subtree holding (key, element)


All Packages  Class Hierarchy  This Package  Previous  Next  Index