public class SetOperations extends Object
| Constructor and Description |
|---|
SetOperations() |
| Modifier and Type | Method and Description |
|---|---|
static <T> Set<T> |
complement(Set<T> a,
Set<T> b)
Returns the complement (a without elements also in b) of
a
and b. |
static <T> Set<T> |
intersection(Set<T> a,
Set<T> b)
Returns the intersection (a \cap b, all common elements) of
a and b. |
static <T> Set<T> |
newSet(Collection<? extends T> c)
Creates a new typed
LinkedHashSet (preserving order of insertion)
from the given collection. |
static <T> Set<T> |
symmetricDifference(Set<T> a,
Set<T> b)
Returns the symmetric set difference
(
union(complement(a,b),complement(b,a))) on a
and b. |
static <T> Set<T> |
union(Set<T> a,
Set<T> b)
Returns the union (a+b) of
a and b. |
public static <T> Set<T> newSet(Collection<? extends T> c)
LinkedHashSet (preserving order of insertion)
from the given collection.T - the value typec - the collectionpublic static <T> Set<T> union(Set<T> a, Set<T> b)
a and b.T - the value typea - set ab - set bpublic static <T> Set<T> intersection(Set<T> a, Set<T> b)
a and b.T - the value typea - set ab - set bpublic static <T> Set<T> complement(Set<T> a, Set<T> b)
a
and b.T - the value typea - set ab - set bCopyright © 2018 Leibniz-Institut für Analytische Wissenschaften – ISAS – e.V.. All rights reserved.