il.ac.tau.cs.sw1.sortedset.eager
Class BinaryOpSortedSet<T extends java.lang.Comparable<T>>

java.lang.Object
  extended by il.ac.tau.cs.sw1.sortedset.eager.BinaryOpSortedSet<T>
All Implemented Interfaces:
SortedSet<T>
Direct Known Subclasses:
IntersectionSortedSet, SymetricDifferenceSortedSet, UnionSortedSet

public abstract class BinaryOpSortedSet<T extends java.lang.Comparable<T>>
extends java.lang.Object
implements SortedSet<T>


Constructor Summary
BinaryOpSortedSet(SortedSet<T> setA, SortedSet<T> setB)
          Constructs a new CompositeSortedSet from two preexisting sets
 
Method Summary
 boolean contains(T element)
          Return true if this set contains the specified element.
 T getMaximum()
          Return the maximal (highest) element in this set.
 T getMinimum()
          Return the minimal (lowest) element in this set.
 boolean isEmpty()
          Return true if this set contains no elements.
 SortedIterator<T> iterator()
          Return an iterator over the elements of this set.
 int size()
          Return the number of elements in this set (its cardinality).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryOpSortedSet

public BinaryOpSortedSet(SortedSet<T> setA,
                         SortedSet<T> setB)
Constructs a new CompositeSortedSet from two preexisting sets

Parameters:
setA - - the first set in the composition
setB - - the second set in the composition
Method Detail

size

public int size()
Description copied from interface: SortedSet
Return the number of elements in this set (its cardinality).

Specified by:
size in interface SortedSet<T extends java.lang.Comparable<T>>
Returns:
the number of elements in this set (its cardinality)

contains

public boolean contains(T element)
Description copied from interface: SortedSet
Return true if this set contains the specified element.

Specified by:
contains in interface SortedSet<T extends java.lang.Comparable<T>>
Returns:
true if this set contains the specified element

getMaximum

public T getMaximum()
Description copied from interface: SortedSet
Return the maximal (highest) element in this set.

Specified by:
getMaximum in interface SortedSet<T extends java.lang.Comparable<T>>
Returns:
the maximal (highest) element in this set

getMinimum

public T getMinimum()
Description copied from interface: SortedSet
Return the minimal (lowest) element in this set.

Specified by:
getMinimum in interface SortedSet<T extends java.lang.Comparable<T>>
Returns:
the minimal (lowest) element in this set

isEmpty

public boolean isEmpty()
Description copied from interface: SortedSet
Return true if this set contains no elements.

Specified by:
isEmpty in interface SortedSet<T extends java.lang.Comparable<T>>
Returns:
true if this set contains no elements

iterator

public SortedIterator<T> iterator()
Description copied from interface: SortedSet
Return an iterator over the elements of this set. The elements are returned in ascending order.

Specified by:
iterator in interface SortedSet<T extends java.lang.Comparable<T>>
Returns:
an iterator over the elements in this set