package labs.linkedlists;

/**
 * A simple list interface.
 */
public interface SimpleList<E> extends Iterable<E> {

  /**
   * Adds the specified element to the end of this list.
   * 
   * @param e the element to add
   */
  void add(E e);

  /**
   * Adds the specified element to the beginning of this list.
   * 
   * @param e the element to add
   */
  void addFirst(E e);

  /**
   * Returns the element at the specified position in this list.
   * 
   * @throws IndexOutOfBoundsException if the provided index is out of bounds.
   * @param index the index of the element to return
   * @return the element at the specified position in this list
   */
  E get(int index);

  /**
   * Returns true if this list contains the specified element.
   * 
   * @param e the element to check for
   * @return true if this list contains the specified element
   */
  boolean contains(E e);

  /**
   * Removes the element at the specified position in this list.
   * 
   * @param index the index of the element to remove
   */
  void remove(int index);

  /**
   * Removes all of the elements from this list.
   */
  void clear();

  /**
   * Gets the size of the list.
   * 
   * @return the number of elements in this list
   */
  int size();
}
