/** * Very simple dictionaries that map keys to values. * * @author Samuel A. Rebelsky * @version 1.0 of November 1999 */ public interface Dictionary { /** * Add an entry to the dictionary. * Pre: The key and value are non-null. * Pre: The key can be compared to other values in the dictionary. * Post: Subsequent calls to get(key) will return value. * * @exception Exception * If the key cannot be compared. */ public void put(Object key, Object value) throws Exception; /** * Look up an entry in the dictionary. * Pre: The key is non-null. * Pre: The key can be compared to other values in the dictionary. * Post: Returns the value most recently "put" with the key. * * @exception Exception * If the key cannot be compared or there is no such entry. */ public Object get(Object key) throws Exception; } // interface Dictionary