    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.

##

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

##

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

##

RBPair

     public RBPair(Object k,
                   Object v)

  Make a cell with given key and element values, and null links

##

clone

     protected Object clone() throws CloneNotSupportedException

  Make a new node with same key and element values, but null links

  Overrides:
    clone in class RBCell

key

     public final Object key()

  return the key

key

     public final void key(Object k)

  set the key

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

count

     public int count(Object element,
                      Comparator cmp)

  Implements RBCell.count.

  Overrides:
    count in class RBCell
  See Also:
    count

findKey

     public RBPair findKey(Object key,
                           Comparator cmp)

  find and return a cell holding key, or null if no such

find

     public RBPair find(Object key,
                        Object element,
                        Comparator cmp)

  find and return a cell holding (key, element), or null if no such

countKey

     public int countKey(Object key,
                         Comparator cmp)

  return number of nodes of subtree holding key

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