All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class collections.LLPair

java.lang.Object
   |
   +----collections.Cell
           |
           +----collections.LLCell
                   |
                   +----collections.LLPair

public class LLPair
extends LLCell
implements Pair
LLPairs are LLCells with keys, and operations that deal with them. As with LLCells, the are pure implementation tools.


Constructor Index

 o LLPair()
Make a pair with null key, elment, and next link
 o LLPair(Object, Object)
Make a pair with given key and element, and null next link
 o LLPair(Object, Object, LLPair)
Make a cell with given key, elment, and next link

Method Index

 o clone()
Clone is SHALLOW; i.e., just makes a copy of the current cell
 o count(Object, Object)
Return the number of cells with indicated pair
 o countKey(Object)
Return the number of cells with key() key.
 o find(Object, Object)
return a cell holding the indicated pair or null if no such
 o findKey(Object)
return a cell with key() key or null if no such
 o index(Object, Object)
Return the number of cells traversed to find a cell with indicated pair or -1 if not present
 o indexKey(Object)
Return the number of cells traversed to find a cell with key() key, or -1 if not present
 o key()
return the key
 o key(Object)
set the key

Constructors

 o LLPair
 public LLPair(Object k,
               Object v,
               LLPair n)
Make a cell with given key, elment, and next link

 o LLPair
 public LLPair(Object k,
               Object v)
Make a pair with given key and element, and null next link

 o LLPair
 public LLPair()
Make a pair with null key, elment, and next link

Methods

 o key
 public final Object key()
return the key

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

 o findKey
 public final LLPair findKey(Object key)
return a cell with key() key or null if no such

 o find
 public final LLPair find(Object key,
                          Object element)
return a cell holding the indicated pair or null if no such

 o indexKey
 public final int indexKey(Object key)
Return the number of cells traversed to find a cell with key() key, or -1 if not present

 o index
 public final int index(Object key,
                        Object element)
Return the number of cells traversed to find a cell with indicated pair or -1 if not present

 o countKey
 public final int countKey(Object key)
Return the number of cells with key() key.

 o count
 public final int count(Object key,
                        Object element)
Return the number of cells with indicated pair

 o clone
 protected Object clone() throws CloneNotSupportedException
Clone is SHALLOW; i.e., just makes a copy of the current cell

Overrides:
clone in class LLCell

All Packages  Class Hierarchy  This Package  Previous  Next  Index