Class HashedDictionary<K,V>

java.lang.Object
  extended by HashedDictionary<K,V>

public class HashedDictionary<K,V>
extends java.lang.Object

A class that implements the ADT dictionary by using hashing and linear probing to resolve collisions. The dictionary is unsorted and has distinct search keys. Notes: Uses probe for add, but locate for remove and getValue. Uses linear probing, but includes code for quadratic probing. Has a display method for illustration and testing.

Version:
3.0
Author:
Frank M. Carrano

Constructor Summary
HashedDictionary()
           
HashedDictionary(int tableSize)
           
 
Method Summary
 V add(K key, V value)
           
 void clear()
           
 boolean contains(K key)
           
 void display()
           
 java.util.Iterator<K> getKeyIterator()
           
 int getSize()
           
 V getValue(K key)
           
 java.util.Iterator<V> getValueIterator()
           
 boolean isEmpty()
           
 boolean isFull()
           
 V remove(K key)
           
 
Methods inherited from class
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashedDictionary

public HashedDictionary()

HashedDictionary

public HashedDictionary(int tableSize)
Method Detail

add

public V add(K key,
             V value)

clear

public final void clear()

contains

public boolean contains(K key)

display

public void display()

getKeyIterator

public java.util.Iterator<K> getKeyIterator()

getSize

public int getSize()

getValue

public V getValue(K key)

getValueIterator

public java.util.Iterator<V> getValueIterator()

isEmpty

public boolean isEmpty()

isFull

public boolean isFull()

remove

public V remove(K key)