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 */ Rabbit first() throws NoSuchElementException; /** * The last element in the linked list * * @return the last elment * @throws NoSuchElementException if the linked list is empty */ Rabbit last() throws NoSuchElementException; /** * Add a rabbit at the end of the list * * @param c the rabbit to be added */ void addLast(Rabbit c); /** * Add a rabbit at the front of the list * * @param c the rabbit to be added */ void addFirst(Rabbit c); /** * Remove the first rabbit from the list * * @return the first rabbit, or null if the list is empty */ Rabbit removeFirst(); /** * Remove the last rabbit from the list * * @return the last rabbit, or null if the list is empty */ Rabbit removeLast(); /** * Remove the specified rabbit from the list * * @param r the rabbit to be removed * @return the removed rabbit, or null is the rabbit was not in the list */ Rabbit remove(Rabbit r); /** * Find a rabbit in the list by its iD * * @param iD * @return the found rabbit, or null if a match could not be found */ Rabbit find(String iD); }