Class Sets

java.lang.Object
com.pnfsoftware.jeb.util.collect.Sets

public class Sets extends Object
Utility methods for sets.
  • Constructor Details

    • Sets

      public Sets()
  • Method Details

    • newHashSet

      @SafeVarargs public static <T> HashSet<T> newHashSet(T... elts)
      Create and initialize a new HashSet with the provided values.
      Type Parameters:
      T -
      Parameters:
      elts -
      Returns:
    • createNonNulls

      @SafeVarargs public static <T> HashSet<T> createNonNulls(T... elts)
      Create and initialize a new HashSet with the provided values. If a null value is provided, it will not be added to the set.
      Type Parameters:
      T -
      Parameters:
      elts -
      Returns:
    • getEntryByIndex

      public static <T> T getEntryByIndex(Set<T> set, int index)
      Retrieve the value in a set by index. If the set is not a SortedSet, the result may be different for each invocation.
      Type Parameters:
      T -
      Parameters:
      set -
      index -
      Returns: