edu.illinois.cs.cogcomp.lbj.coref.util.collections
Class MySets

java.lang.Object
  extended by edu.illinois.cs.cogcomp.lbj.coref.util.collections.MySets

public class MySets
extends java.lang.Object


Constructor Summary
MySets()
           
 
Method Summary
static
<T> java.util.Set<T>
getDifference(java.util.Collection<T> a, java.util.Collection<T> b)
           
static
<T> java.util.Set<T>
getIntersection(java.util.Collection<T> a, java.util.Collection<T> b)
           
static
<T> java.util.Set<T>
getSymmetricDifference(java.util.Collection<T> a, java.util.Collection<T> b)
           
static
<T> java.util.Set<T>
getUnion(java.util.Collection<T> a, java.util.Collection<T> b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MySets

public MySets()
Method Detail

getIntersection

public static <T> java.util.Set<T> getIntersection(java.util.Collection<T> a,
                                                   java.util.Collection<T> b)
Returns:
a new Set that contains all objects found in both a and b.

getUnion

public static <T> java.util.Set<T> getUnion(java.util.Collection<T> a,
                                            java.util.Collection<T> b)
Returns:
a new Set that contains all objects found in either a or b.

getDifference

public static <T> java.util.Set<T> getDifference(java.util.Collection<T> a,
                                                 java.util.Collection<T> b)
Returns:
a new Set containing all objects that are in a and are not in b. i.e. returns a - b. Note that this difference is NOT symmetric.

getSymmetricDifference

public static <T> java.util.Set<T> getSymmetricDifference(java.util.Collection<T> a,
                                                          java.util.Collection<T> b)
Returns:
A new Set containing the objects in exactly one of a or b.