Package com.pnfsoftware.jeb.util.collect
Class Sets
java.lang.Object
com.pnfsoftware.jeb.util.collect.Sets
Utility methods for
sets.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> HashSet<T> createNonNulls(T... elts) Create and initialize a newHashSetwith the provided values.static <T> TgetEntryByIndex(Set<T> set, int index) Retrieve the value in a set by index.static <T> HashSet<T> newHashSet(T... elts) Create and initialize a newHashSetwith the provided values.
-
Constructor Details
-
Sets
public Sets()
-
-
Method Details
-
newHashSet
Create and initialize a newHashSetwith the provided values.- Type Parameters:
T- element type- Parameters:
elts- elements to add- Returns:
- a new hash set
-
createNonNulls
Create and initialize a newHashSetwith the provided values. If a null value is provided, it will not be added to the set.- Type Parameters:
T- element type- Parameters:
elts- elements to add- Returns:
- a new hash set without null elements
-
getEntryByIndex
Retrieve the value in a set by index. If the set is not aSortedSet, the result may be different for each invocation.- Type Parameters:
T- element type- Parameters:
set- input setindex- zero-based iteration index- Returns:
- the entry at the requested iteration index
-