|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectDataStructures.ProbingHashTable<K,V>
K - the type of objects serving as keysV - the type of objects serving as valuespublic abstract class ProbingHashTable<K,V>
An abstract class implementing the LookupTable interface by means of a probing hash table.
This class must be extended to implement a particular probing algorithm.
DoubleHashingTable,
QuadraticProbingTable| Method Summary | |
|---|---|
void |
add(K key,
V value)
Adds the specified entry to the table. |
boolean |
contains(K key)
Returns true if the table contains an entry for this key. |
boolean |
isEmpty()
Tests if the table is empty. |
java.util.Iterator<LookupTable.Entry<K,V>> |
iterator()
Returns an iteration over the entries in this lookup table. |
V |
lookup(K key)
Returns the value associated with the specified key. |
void |
remove(K key)
Removes the entry corresponding to the key. |
int |
size()
Returns the number of entries in the table. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public final boolean isEmpty()
LookupTable
isEmpty in interface LookupTable<K,V>public final int size()
LookupTable
size in interface LookupTable<K,V>public final boolean contains(K key)
LookupTable
contains in interface LookupTable<K,V>key - the key to be searched for
public final void add(K key,
V value)
LookupTable
add in interface LookupTable<K,V>key - the key of the entryvalue - the value of the entrypublic final void remove(K key)
LookupTable
remove in interface LookupTable<K,V>key - the key of the entry to be removedpublic final V lookup(K key)
LookupTable
lookup in interface LookupTable<K,V>key - the key to be searched for
public java.util.Iterator<LookupTable.Entry<K,V>> iterator()
LookupTable
iterator in interface LookupTable<K,V>iterator in interface java.lang.Iterable<LookupTable.Entry<K,V>>LookupTable.Entry
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||