public class ListEntry implements Entry { private K key; private V value; public ListEntry prev; // ListEntry needs links !! public ListEntry next; public ListEntry(K k, V v) { key = k; value = v; prev = null; next = null; } /** Returns the key stored in this entry. */ public K getKey() { return key; } /** Returns the value stored in this entry. */ public V getValue() { return value; } public V setValue(V val) { V oldValue = value; value = val; // Update value return oldValue; // Return old value } public String toString() { return( "[" + key + "," + value + "]" ); } }