edu.illinois.cs.cogcomp.lbj.coref.util.collections
Class MySets
java.lang.Object
edu.illinois.cs.cogcomp.lbj.coref.util.collections.MySets
public class MySets
- extends java.lang.Object
Method Summary |
static
|
getDifference(java.util.Collection<T> a,
java.util.Collection<T> b)
|
static
|
getIntersection(java.util.Collection<T> a,
java.util.Collection<T> b)
|
static
|
getSymmetricDifference(java.util.Collection<T> a,
java.util.Collection<T> b)
|
static
|
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 |
MySets
public MySets()
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.