import java.util.NoSuchElementException; public interface LinkedListInterface> { /** * The number of items in the linked list * * @return the number of items in the linked list */ int size(); /** * Returns true iff the linked list has no elements * * @return true iff the linked list has no elements */ boolean isEmpty(); /** * Get the first element in the linked list * * @return the first element in the linked list * @throws NoSuchElementException is the list is empty */ E first() throws NoSuchElementException; /** * The last element in the linked list * * @return the last elment * @throws NoSuchElementException if the linked list is empty */ E last() throws NoSuchElementException; /** * Add an element at the end of the list * * @param c the element to be added */ void addLast(E c); /** * Add a element at the front of the list * * @param c the Element to be added */ void addFirst(E c); /** * Remove the first element from the list * * @return the first element, or null if the list is empty */ E removeFirst(); /** * Remove the last element from the list * * @return the last element, or null if the list is empty */ E removeLast(); /** * Remove the specified element from the list * * @param r the element to be removed * @return the removed element, or null is the element was not in the list */ E remove(E r); /** * Find a element in the list by its iD * * @param iD * @return the found element or null if a match could not be found */ E find(E iD); }