package uebung09.collection; /** * A set of elements that does not contain any element twice. * * @param the type of all contained elements. */ public interface Set extends Iterable { /** * Returns the number of elements stored in this set. * * @return the number of elements in this set */ int size(); /** * Returns true if this set contains no elements. * * @return true if this set contains no elements */ boolean isEmpty(); /** * Returns true if this set contains the specified element. * * @return true if this set contains the specified element. */ boolean contains(Object el); /** * Returns the union set of this set and the specified set. * * @param other a set * @return the union set of this set and the specified set. */ Set union(Set other); /** * returns the set resulting from adding the specified element to this set. * * @param elem an element (must not be null) * @return the set resulting from adding the specified element to this set. */ Set add(E elem); /** * Returns the intersection of this set and the specified set. * * @param other a set * @return the intersection of this set and the specified set. */ Set intersection(Set other); /** * Returns true if all elements of this set are contained in the specified set. * * @param other a set * @return true if all elements of this set are contained in the specified set. */ boolean subsetOf(Set other); }