/*
 * Interface Set.java
 *
 * Specifies the implementation of the Set ADT
 */

public interface Set {
    public static final int MAX_SIZE = 16;
    /**
     *  insert element into the set (if not present)
     *  precondition:  element is in the universe of possible elements
     *  post-condition: element is in set, size is increased by 1
     *  @param element
     *  @return true if operation done, false if precondition not met
     */
    public boolean add(int element);
    /** 
     *  remove element from set
     *  precondition: element is in universe and in set
     *  post-condition: element removed from set, size decreased
     *  @param element
     *  @return true if precondition met, false if operation not done
     */  
    public boolean remove(int element);
    /** 
     *  set containing all elements in this and other returned
     *  post-condition: this set unchanged, new set returned, and
     *      min(this.size(), other.size())<= union.size() <= max
     *      (this.size(), other.size())
     *  @param otherSet -- defined over same univers as this set
     *  @return Set -- the union of the two sets
     */
    public Set union(Set other);
    /** 
     *  set containing all elements in both this and other returned
     *  post-condition: this set unchanged, new set returned, and
     *      intersection.size() <= min(this.size(), other.size())
     *  @param otherSet -- defined over same univers as this set
     *  @return Set -- the intersection of the two sets
     */
    public Set intersection(Set other);
    /**
     *  returns true if element is in this set
     *  precondition: none
     *  post-condition: set is unchanged
     *  @param element
     *  @return boolean
     */
    public boolean contains(int element);
     /**
     *  returns true if set is empty
     *  precondition: none
     *  post-condition: set is unchanged
     *  @return boolean
     */
    public boolean isEmpty();
    /**
     *  returns number of elements in this set
     *  precondition: none
     *  post-condition: set is unchanged
     *  @return int
     */
    public int size();    
}
