import java.lang.IndexOutOfBoundsException;

/** K_SimpleList provides a simplified, stripped down version of the 
 *  Java List interface, with fewer methods to implement.
 *
 *  @author Alyce Brady
 *  @version Fall 2025
 */
public interface K_SimpleList<T>
{
    /**
     * Returns the number of elements in the list.
     */
    int size();

    /** Returns <code>true</code> if this list contains no elements;
     *  <code>false</code> otherwise.
     **/
    boolean isEmpty();

    /**
     * Adds the specified element to the list.
     *   @param newElement the element to add
     */
    void add(T newElement);

    /**
     * Returns the element at the specified index. Throws
     * an IndexOutOfBoundsException if the index is out of bounds.
     *  
     *   @param index - position of the element to get
     *   @return the element at the specified index
     *   @throws IndexOutOfBoundsException
     */
    T get(int index) throws IndexOutOfBoundsException;

    /**
     * Returns the index of the given element, or -1 if the
     * given element is not in the list.
     *  
     *   @param the element to find in the list
     *   @return position of the found element
     */
    int find(T element);

    /**
     * Returns true if the given element is in the list, or false
     * otherwise.
     *  
     *   @param the element to find in the list
     *   @return true if the element is in the list; false otherwise
     */
    boolean contains(T element);

    /**
     * Removes and returns the element at the specified index. Throws
     * an IndexOutOfBoundsException if the index is out of bounds.
     *  
     *   @param index - position of the element to remove
     *   @return the element that was removed
     *   @throws IndexOutOfBoundsException
     */
    T remove(int index) throws IndexOutOfBoundsException;

}
