Interface HashTableEntry

All Known Implementing Classes:
HashTableTest.IntEntry, HashTableTestSimple.IntEntry, InformationRecord

public interface HashTableEntry

Interface HashTableEntry defines the getKey and hash methods that an entry in a HashTable must implement.


Method Summary
 java.lang.Object getKey()
          Return the key used to enter, lookup, and delete from a hash table.
 int hash(java.lang.Object key, int tableSize)
          Compute the hash index for the given key modulo the given table size.
 

Method Detail

getKey

public java.lang.Object getKey()
Return the key used to enter, lookup, and delete from a hash table.

Implementors of this method return the value of the data field that is used as the unique key for the entry.


hash

public int hash(java.lang.Object key,
                int tableSize)
Compute the hash index for the given key modulo the given table size. The key value must be the same type as that returned by getKey.

Implementors of this method return a suitable hash key for the entry. It is the implementor's responsibility to ensure adequate table coverage by the set of values returned from this method.