import java.util.Iterator; public interface Set extends Collection{ /**Adds the specified element to this set if not already present*/ public boolean add(E e); /**Adds all of the elements in the specified collection to this set if not already present*/ public boolean addAll(Collection c); /**Removes all of the elements from this set*/ public void clear(); /**Returns true if this collection contains the specified element*/ public boolean contains(Object o); /**Returns true if this set contains all of the elements in the specified collection*/ public boolean containsAll(Collection c); /**Compares the specified object with this set for equality*/ public boolean equals(Object o); /**Returns the hash code value for this set*/ public int hashCode(); /**Returns true if this set contains no elements*/ public boolean isEmpty(); //will get this for free //**Returns an iterator over the elements in this set*/ //public Iterator iterator(); /**Removes the specified element from this set, if it is present*/ public boolean remove(Object o); /**Removes from this set all of its elements that are contained in the specified collection*/ public boolean removeAll(Collection c); /**Retains only the elements in this set that are contained in the specified collection*/ public boolean retainAll(Collection c); /**Returns the number of alements in this set (its cardinality*/ public int size(); /**Returns an array containing all the elements in this set*/ public Object[] toArray(); /**Returns an array containing all of the elements in this set, the runtime type * of the returned array is that of the specified array */ public T[] toArray(T[] a); }