/* Andrew Coleman CSC-2020 10:00 AM */ import java.util.Iterator; public interface ListSortedInterface { /** * Checks to see if the list is empty and returns a boolean value.
* Preconditions: none. * Postconditions: Returns true if empty, false if it is not empty. */ public boolean isEmpty(); /** * Returns the current size of the list.
* Preconditions: none. * Postconditions: Returns an interger of the size. */ public int size(); /** * Adds a Comparable item to the list.
* Preconditions: Requires a Comparable item to insert into the list. * Postconditions: Inserts the Comparable item in the list. * Throws: Throws a ListException if you try and add a duplicate entry into the list. */ public void add(Comparable item) throws ListException; /** * Removes an item from the list.
* Preconditions: Requires a Comparable item to remove. * Postconditions: Removes the item from the list. * Throws: Throws a ListException if the item is not found. */ public void remove(Comparable item) throws ListException; /** * Returns an item in the list at the specified index.
* Preconditions: A valid integer index value. * Postconditions: Returns a Comparable object at the said index. * Throws: Throws a ListException if the index value is out of range. */ public Comparable get(int index) throws ListException; /** * Removes all entries in the list.
* Preconditions: None. * Postconditions: Removes all items in the list. */ public void removeAll(); /** * Creates an Iterator to cycle through the list.
* Preconditions: None. * Postconditions: Returns the Iterator for the list. */ public Iterator iterator(); }