/*
 * Created on Jan 28, 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package ece.uprm.admg.cs2.util;

/**
 * This interface is used to specify the methods associated with a Set.
 * @author manuel
 *
 */
public interface Set {
	/**
	 * Adds a new object to this Set, if not already present
	 * @param obj - the new object to be added.
	 */
	public void add(Object obj);
	

	/**
	 * Removes an object from the Set, returning true if the element is found and erased 
	 * or false otherwise.
	 * @param obj - the objecto to be removed
	 * @return true if the object is removed, or false otherwise.
	 */
	public boolean remove(Object obj);
	
	/**
	 * Determines is an object obj is contained in the Set. 
	 * @param obj - the object to be searched for.
	 * @return true is the object obj is in this Set, or false otherwise.
	 */
	public boolean contains(Object obj);
	
	/**
	 * Returns the number of elements in the Set.
	 * @return the number of elements in the Set.
	 */
	public int size();
	
	/**
	 * Determines if a Set is the empty Set.
	 * @return true if the set is empty, or false otherwise.
	 */
	public boolean isEmpty();
	
	/**
	 * Removes all the elements from the Set, making it an empty set.
	 */
	public void makeEmpty();
	
	/**
	 * Add all the elements from set S into this set. This method is equivalent to 
	 * A = A union S.
	 * @param S - the set to be combined with this set.
	 * @return the new value for this set, after taking the union.
	 */
	public Set add(Set S);
	
	/**
	 * Determines if a set S is a subset of this set.
	 * @param S - the set to be tested.
	 * @return true if the set S is a subset of this set, or false otherwise.
	 */
	public boolean isSubSet(Set S);
	
	/**
	 * Computes the union between a set S and this set, and returns its result.
	 * This is equivalent to C = A union B, where A is this set and B is the parameter.
	 * @param S - the set to be combined with this set.
	 * @return a new set representing the union of set S with this set.
	 */
	public Set union(Set S);
	
	/**
	 * Computes the difference between a set S and this set, and returns its result.
	 * This is equivalent to C = A difference B, where A is this set and B is the 
	 * parameter.
	 * @param S - the set to be compared with this set.
	 * @return a new set representing the differene of this set with the set S.
	 */
	public Set difference(Set S);
	
	/**
	 * Computes the intersection between a set S and this set, and returns its result.
	 * This is equivalent to C = A intersection B, where A is this set and B is the 
	 * parameter.
	 * @param S - the set to be intersected with this set.
	 * @return a new set representing the intersection of set S with this set.
	 */
	public Set intersection(Set S);
	

}
