public class SetUtils
extends java.lang.Object
| Constructor | Description |
|---|---|
SetUtils() |
| Modifier and Type | Method | Description |
|---|---|---|
static <T> java.util.Set<T> |
getDifference(java.util.Set<T> s1,
java.util.Set<T> s2) |
Returns the set difference between the set
s1 and the set
s2. |
static <T> java.util.Set<T> |
getIntersection(java.util.List<java.util.Set<T>> sets) |
Returns the intersection of all sets contained in the list
sets. |
static <T> java.util.Set<T> |
getIntersection(java.util.Set<T> s1,
java.util.Set<T> s2) |
Returns the intersection of set
s1 and set s2. |
static <T> java.util.Set<T> |
getUnion(java.util.List<java.util.Set<T>> sets) |
Returns the union of all sets contained in the list
sets. |
static <T> java.util.Set<T> |
getUnion(java.util.Set<T> s1,
java.util.Set<T> s2) |
Returns the union of set
s1 and set s2. |
public static <T> java.util.Set<T> getDifference(java.util.Set<T> s1,
java.util.Set<T> s2)
s1 and the set
s2.T - Type of the sets' entries.s1 - A set.s2 - Another set.public static <T> java.util.Set<T> getIntersection(java.util.Set<T> s1,
java.util.Set<T> s2)
s1 and set s2.
Returns an empty set if the intersection is empty, i.e., does not return
null.T - Type of the sets' entries.s1 - A set.s2 - Another set.public static <T> java.util.Set<T> getIntersection(java.util.List<java.util.Set<T>> sets)
sets.T - Type of the sets' entries.sets - A list of setspublic static <T> java.util.Set<T> getUnion(java.util.Set<T> s1,
java.util.Set<T> s2)
s1 and set s2.T - Type of the sets' entries.s1 - A set.s2 - Another set.public static <T> java.util.Set<T> getUnion(java.util.List<java.util.Set<T>> sets)
sets.T - Type of the sets' entries.sets - A list of sets.