// ******************************************************************************* // Interface ListInterface for the List ADT. // ******************************************************************************* public interface ListInterface { public int size(); // Description: Determines the length of a list (number of elements stored in the list). // Precondition: None. // Postcondition: Returns the number of elements that are currently stored in the list. // Throws: None. public void removeAll(); // Description: Deletes all the elements from the list. // Precondition: None. // Postcondition: The list is empty. // Throws: None. public void insert(Object thisElement) throws ListFullException, ListException; // Description: Adds an element to the list. // Precondition: None. // Postcondition: If insertion is successful, "thisElement" is stored in the list. // Throws: ListFullException if list is full. // Throws: ListException if "thisElement" cannot be placed in the list for whathever other reason not yet dealt with. public void remove(Object thisElement) throws ObjectDoesNotExistException; // Description: Deletes this element from the list. // Precondition: None. // Postcondition: The designated element in the list is deleted. // Throws: ObjectDoesNotExistException if thisElement is not found in the list. public boolean isInList(Object thisObject); // Description: Check if the designated Object is an element of the list. // Precondition: None. // Postcondition: Returns "true", if "thisObject" is in the list; "false" otherwise. // Throws: None. } // end ListInterface