mathCollection
Class AbstractSetOfSets

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractSet
          extended bymathCollection.AbstractSetOfSets
All Implemented Interfaces:
java.util.Collection, java.util.Set, SetOfSets
Direct Known Subclasses:
HashSetOfSets

public abstract class AbstractSetOfSets
extends java.util.AbstractSet
implements SetOfSets

This class provides a skeletal implementation of the SetOfSets interface to minimize the effort required to implement this interface.

See Also:
Set, AbstractSet, SetOfSets

Constructor Summary
AbstractSetOfSets()
           
 
Method Summary
 boolean containsAtom(java.lang.Object o)
          Returns true if this set of sets contains a set in which the specified element is present.
 int hashCode()
          Returns the hash code value for this set of sets.
 java.lang.String toString()
          Returns a string representation of this set of sets.
 
Methods inherited from class java.util.AbstractSet
equals, removeAll
 
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, retainAll, size, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface mathCollection.SetOfSets
add, containingSets, contains, remove, subsets, supersets, toMultiset, toSet
 
Methods inherited from interface java.util.Set
addAll, clear, containsAll, equals, isEmpty, iterator, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

AbstractSetOfSets

public AbstractSetOfSets()
Method Detail

hashCode

public int hashCode()
Returns the hash code value for this set of sets. To get the hash code of this set of sets, new hash code values for every element of this set of sets are calculated from a polynomial of 3rd order and finally summed up. This ensures that s1.equals(s2) implies that s1.hashCode()==s2.hashCode() for any two set of sets s1 and s2, as required by the general contract of Object.hashCode().

Specified by:
hashCode in interface java.util.Set
Returns:
the hash code value for this set of sets.

containsAtom

public boolean containsAtom(java.lang.Object o)
Returns true if this set of sets contains a set in which the specified element is present.

Specified by:
containsAtom in interface SetOfSets
Parameters:
o - the element whose presence in any elementary set within this set of sets is tested for.
Returns:
true if any set within this set of sets contains the specified element, false otherwise.

toString

public java.lang.String toString()
Returns a string representation of this set of sets. The string representation consists of a list of the set's elementary sets in the order they are returned by its iterator, enclosed in curly brackets ("{}"). Adjacent sets are separated by the characters ", " (comma and space). Elementary sets are converted to strings as by Object.toString().

Returns:
a string representation of this set of sets.