package material.u05;
/**
* Interface for a dictionary data type. The dictionary contains pairs of keys
* of type K
and elements of type E
. It supports
* methods to insert, remove and find such pairs based on the key values.
*
* @author Martin Mader, University of Konstanz
* @param the key type
* @param the element type
*
*/
public interface IDictionary, E> {
/**
* finds the first key-element pair with a given key.
* @param key the key
* @return the first element associated with the given key or null
if
* no such key exists
*/
public E find(K key);
/**
* inserts a key-element pair to the dictionary.
* @param key the key
* @param element the element to insert
* @return the element of the inserted key-element pair
*/
public E insert(K key, E element);
/**
* deletes the first appearing key-element pair corresponding to the given key.
* @param key the key
* @return the element of the removed key-element pair.
*/
public E delete(K key);
}