/* ITI 1121/1521. Introduction to Computer Science II * Assignment/Devoir 3 * * */ public abstract class AbstractList implements Collection { /** Implements the logical equality. Returns true if the two * lists contain the same number of elements, and the elements at * the corresponding positions are "equals". * * @param An implementation of AbstractList * @return true if both lists are equal */ public boolean eq( AbstractList other ) { throw new UnsupportedOperationException( "Replace this statement by your answer to the question!" ); } /** Adds an element at the beginning of the list. * * @param elem the element to be added * @return true if the list changed as a result of this operation * @exception IllegalArgumentException if elem is null */ public abstract boolean addFirst( E elem ); /** Returns the element at position pos of this list. * * @param index of the element to be returned * @return elem at position pos * @exception IndexOutOfBoundsException if pos is out of range */ public abstract E get( int pos ); /** Returns the logical size of the list, i.e. the number of elements. * * @return the logical size of the list */ public abstract int size(); }