Package com.wowza.util
Class SetUtils
- Object
-
- com.wowza.util.SetUtils
-
public class SetUtils extends Object
Static utilities for standard set operations: union, intersection, difference, subset and superset.
-
-
Constructor Summary
Constructors Constructor Description SetUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> java.util.Set<T>
diff(java.util.Set<T> set1, java.util.Set<T> set2)
Create difference of the 2 sets.static <T> java.util.Set<T>
intersection(java.util.Set<T> set1, java.util.Set<T> set2)
Create intersection of 2 sets.static <T> boolean
isSubset(java.util.Set<T> set1, java.util.Set<T> set2)
Determines if set1 is a subset of set2.static <T> boolean
isSuperset(java.util.Set<T> set1, java.util.Set<T> set2)
Determines if set1 is a superset of set2.static <T> java.util.Set<T>
union(java.util.Set<T> set1, java.util.Set<T> set2)
Create union of 2 sets.
-
-
-
Method Detail
-
intersection
public static <T> java.util.Set<T> intersection(java.util.Set<T> set1, java.util.Set<T> set2)
Create intersection of 2 sets.- Type Parameters:
T
- type of the sets- Parameters:
set1
- First setset2
- Second set- Returns:
- a new Set, containing the intersection of the 2 sets.
-
union
public static <T> java.util.Set<T> union(java.util.Set<T> set1, java.util.Set<T> set2)
Create union of 2 sets.- Type Parameters:
T
- type of the sets- Parameters:
set1
- First setset2
- Second set- Returns:
- a new Set, containing the union of the 2 sets.
-
diff
public static <T> java.util.Set<T> diff(java.util.Set<T> set1, java.util.Set<T> set2)
Create difference of the 2 sets.- Type Parameters:
T
- type of the sets- Parameters:
set1
- First setset2
- Second set- Returns:
- a new Set, containing the set1 - set2.
-
isSubset
public static <T> boolean isSubset(java.util.Set<T> set1, java.util.Set<T> set2)
Determines if set1 is a subset of set2.- Type Parameters:
T
- type of the sets- Parameters:
set1
- First setset2
- Second set- Returns:
- true if set1 is subset of set2, otherwise false.
-
isSuperset
public static <T> boolean isSuperset(java.util.Set<T> set1, java.util.Set<T> set2)
Determines if set1 is a superset of set2.- Type Parameters:
T
- type of the sets- Parameters:
set1
- First setset2
- Second set- Returns:
- true if set1 is superset of set2, otherwise false.
-
-