import java.util.NoSuchElementException;

// Source: OpenDSA Data Structures and Algorithms Modules Collection, CHAPTER 9 LINEAR STRUCTURES: https://opendsa-server.cs.vt.edu/ODSA/Books/Everything/html/ListADT.html

// List class ADT. Generalize the element type using Java Generics.
public interface List<E> { // List class ADT
    // Remove all contents from the list, so it is once again empty
    public void clear();

    // Insert "it" at the current location
    // The client must ensure that the list's capacity is not exceeded
    public boolean insert(E it);

    // Append "it" at the end of the list
    // The client must ensure that the list's capacity is not exceeded
    public boolean append(E it);

    // Remove and return the current element
    public E remove() throws NoSuchElementException;

    // Set the current position to the start of the list
    public void moveToStart();

    // Set the current position to the end of the list
    public void moveToEnd();

    // Move the current position one step left, no change if already at beginning
    public void prev();

    // Move the current position one step right, no change if already at end
    public void next();

    // Return the number of elements in the list
    public int length();

    // Return the position of the current element
    public int currPos();

    // Set the current position to "pos"
    public boolean moveToPos(int pos);

    // Return true if current position is at end of the list
    public boolean isAtEnd();

    // Return the current element
    public E getValue() throws NoSuchElementException;

    // Tell if the list is empty or not
    public boolean isEmpty();
}