/** * An interface for linear objects. Designed to support both * static and dynamic implementation. */ public interface Linear { /** * Add an element. * Precondition: There is space for another element. * Precondition: The element to be added is not null. * Postcondition: The element is added to the linear structure. * Postcondition: The size of the structure increases by 1. */ public void add(Object elt); /** * Delete and return an element. Which element is removed is determined * by the ``deletion strategy'' of the particular linear structure. * Precondition: The structure is not empty. * Postcondition: Returns an element in the structure. * Postcondition: Deletes an element from the structure. * Postconditoin: The size of the structure decreases by 1. */ public Object remove(); /** * Is the structure full? (That is, it has no space remaining.) */ public boolean isFull(); /** * Is the structure empty? (That is, it has no elements.) */ public boolean isEmpty(); } // interface Linear