sbrt.kernel.math.comb.comp
Class StrictSingleElementUnions

java.lang.Object
  extended by sbrt.kernel.math.comb.comp.StrictSingleElementUnions

public class StrictSingleElementUnions
extends java.lang.Object

This class is used to compute the single-element unions of collections of sets. A single-element union of sets will contain one, and only one, element from each set. Take, for example, the following collection of sets:

{a, b, c} {d} {e, f}.

The sets of all possible single-element unions from these sets are:
{a, d, e} {a, d, f}
{b, d, e} {b, d, f}
{c, d, e} {c, d, f}.

Here's another, slightly more complicated example. Take the following collection of sets:
{a, b, c} {c, d} {e, f}.

Note that the first and second sets contain the same element c. The sets of all possible single-element unions from these sets are:
{a, d, e} {a, d, f}
{b, d, e} {b, d, f}
{c, e} {c, f}.

Note that the set {c, d, f} (and other similar sets) is not present because it contains more than one element from the set {c, d}.

Author:
This class was written and documented by Jeremiah Wright while in the Wagner lab.

Constructor Summary
StrictSingleElementUnions()
          Constructs a new strict single-element union computer.
 
Method Summary
<E> java.util.Set<java.util.Set<E>>
getSingletonSets(java.util.Set<E> set)
          Returns a set of singleton sets created from the provided set.
<E> java.util.Set<java.util.Set<E>>
getUnions(java.util.Collection<java.util.Set<E>> sets)
          Returns the set of strict single-element unions of the sets in the provided collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrictSingleElementUnions

public StrictSingleElementUnions()
Constructs a new strict single-element union computer.

Method Detail

getSingletonSets

public <E> java.util.Set<java.util.Set<E>> getSingletonSets(java.util.Set<E> set)
Returns a set of singleton sets created from the provided set. The singleton sets each contain a single element from the provided set. This can be thought of as the single-element union of the provided set and the empty set.

Type Parameters:
E - the element type.
Parameters:
set - a single set of elements.
Returns:
a set of singleton sets created from the provided set.

getUnions

public <E> java.util.Set<java.util.Set<E>> getUnions(java.util.Collection<java.util.Set<E>> sets)
Returns the set of strict single-element unions of the sets in the provided collection.

Type Parameters:
E - the element type.
Parameters:
sets - the collection of sets.
Returns:
the set of strict single-element unions in the provided collection of sets.