package containers; public interface IOrderedContainer { /** * If there is an object associated with key * then this object is returned else null is returned. */ public Object find(IOrdered key); /** * Returns the (key,value) with the next smaller key * from that specified, regardless of whether the * specified key is itself in the container. If * there isn't a (key,value) with a smaller key, * returns null. */ public KeyValuePair findPrev(IOrdered key); /** * Returns the (key,value) with the next larger key * from that specified, regardless of whether the * specified key is itself in the container. If * there isn't a (key,value) with a larger key, * returns null. */ public KeyValuePair findNext(IOrdered key); /** * Afterwards, find(key) returns null, and if there is * an object associated with key then this object is * returned else null is returned. */ public Object remove(IOrdered key); /** * (key, value) is stored in this container with no * duplication and such that find(key) returns value. */ public void insert(IOrdered key, Object value); }