ListADT.java - package collection import exceptions. import...

This preview shows page 1 - 2 out of 2 pages.

package collection; import exceptions.ElementNotFoundException; import exceptions.EmptyCollectionException; import java.util.Iterator; //import jsjf.exceptions.*; /** * ListADT defines the interface to a general list collection. Specific * types of lists will extend this interface to complete the * set of necessary operations. * * @author Lewis and Chase * @version 4.0 */ public interface ListADT<T> extends Iterable<T> { /** * Removes and returns the first element from this list. * * @return the first element from this list * @throws exceptions.EmptyCollectionException * @throws exceptions.EmptyCollectionException */ public T removeFirst() throws EmptyCollectionException; /** * Removes and returns the last element from this list. * * @return the last element from this list */ public T removeLast() throws EmptyCollectionException; /** * Removes and returns the specified element from this list. * * @param element the element to be removed from the list */ public T remove(T element) throws EmptyCollectionException, ElementNotFoundException; /** * Returns a reference to the first element in this list. * * @return a reference to the first element in this list

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture