/* ITI 1121/1521. Introduction to Computer Science II * Assignment/Devoir 3 * * */ public interface Collection { /** * Returns an iterator over the elements in this collection. * * @return an Iterator over the elements in this collection */ public abstract Iterator iterator(); /** * Ensures that this collection contains the specified element. * Returns true if this collection changed as a result of the * call. Returns false if this collection does not permit * duplicates and already contains the specified element. * * @param item element whose presence in this collection is to be ensured. * @return true if this collection changed as a result of the call. */ public abstract boolean add( E item ); /* * Removes a single instance of the specified element from this * collection, if it is present. Returns true if this collection * contained the specified element (or equivalently, if this * collection changed as a result of the call). * * @param item element to be removed from this collection, if present. * @return true if this collection changed as a result of the call. */ public abstract boolean remove( E item ); /** * Returns true if this collection contains no elements. * * @return true if this collection contains no elements */ public abstract boolean isEmpty(); }