Algorithm
Development Kit 1.0

algs.model.search
Class HashTable<K,V>

java.lang.Object
  extended by algs.model.search.HashTable<K,V>
All Implemented Interfaces:
IHashtableAccess<K,V>
Direct Known Subclasses:
AssociativeHashTable, ListHashTable

public abstract class HashTable<K,V>
extends java.lang.Object
implements IHashtableAccess<K,V>

Provides the abstract base class for hash tables.

The two known subclasses are ListHashTable and ProbeHashTable.

Since:
1.0
Version:
1.0, 6/15/08
Author:
Gary Pollice, George Heineman

Constructor Summary
HashTable(int tableSize, IHash<K> hashMethod)
          Construct an empty HashTable of the given size.
 
Method Summary
 void remove(java.util.Iterator<K> it)
          Bulk remove elements from the Hash Table from the Iterator of key values.
abstract  java.lang.String report()
          Every Hash Table has the ability to report interesting statistics about itself.
 int size()
          Return the number of elements in the hash table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface algs.model.search.IHashtableAccess
add, remove, search
 

Constructor Detail

HashTable

public HashTable(int tableSize,
                 IHash<K> hashMethod)
Construct an empty HashTable of the given size. The hash method to use is provided as an argument. The structure of the hash table is provided by the appropriate subclass.

Parameters:
tableSize - initial size of the hash table.
hashMethod - method to use when hashing objects.
Method Detail

size

public int size()
Description copied from interface: IHashtableAccess
Return the number of elements in the hash table.

Specified by:
size in interface IHashtableAccess<K,V>

remove

public void remove(java.util.Iterator<K> it)
Bulk remove elements from the Hash Table from the Iterator of key values.

Parameters:
it - Iterator of the elements to be removed from the Hash Table.

report

public abstract java.lang.String report()
Every Hash Table has the ability to report interesting statistics about itself.

Defined by subclasses


Algorithm Development Kit 1.0

This code supports the Algorithms in a Nutshell book, published by O'Reilly Media, Inc. in November 2008. Please visit the book web page to learn of any changes to the code repository or to record a potential defect.