public class CollectionHelper
extends java.lang.Object
Constructor and Description |
---|
CollectionHelper() |
Modifier and Type | Method and Description |
---|---|
static <V> java.util.Set<V> |
difference(java.util.Set<V> set1,
java.util.Set<V> set2)
Returns the difference of two sets (S1\S2).
|
static <V> java.util.Set<V> |
intersection(java.util.Set<V> set1,
java.util.Set<V> set2)
Returns the intersection of two sets.
|
public static <V> java.util.Set<V> intersection(java.util.Set<V> set1, java.util.Set<V> set2)
Set.retainAll(java.util.Collection)
but returns a new set
containing the elements of the intersection.set1
- the first setset2
- the second setpublic static <V> java.util.Set<V> difference(java.util.Set<V> set1, java.util.Set<V> set2)
Set.removeAll(java.util.Collection)
but returns a
new set containing the elements of the difference.set1
- the first setset2
- the second set