/** ****************************************************************************** * HOMEWORK 1, 15-211 ****************************************************************************** * HashTable interface. It is a light version of Java API's HashTable class. * * * @author V.Adamchik * @date 4/27/2007 * @see QuadraticProbingHashSet ******************************************************************************/ /***************************************************************************** Do not modify this file. *****************************************************************************/ public interface HashSetInterface { /** * Adds the specified object to the table. * Id does not insert, if the item is * already present. */ public void add(AnyType value); /** * Tests if the specified object is in the hashtable. * @return true if and only if the specified object * is in the hashtable, */ public boolean contains(AnyType value); /** * Makes the table physically empty. */ public void clear(); /** * Gets the number of elements in the hash table * @return an integer representing the number of items in the table */ public int size(); /** * Rehashes the table when it's half full */ public void rehash(); /** * Removes the item from the table */ public void remove(AnyType item); /** * Finds a prime number at least as large as n. * Precondition: n is always odd and >= 7. */ public int nextPrime(int n); /** * String representation of the table */ public String toString(); }