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 Details

    • SetUtils

      public SetUtils()
  • Method Details

    • intersection

      public static <T> Set<T> intersection(Set<T> set1, Set<T> set2)
      Create intersection of 2 sets.
      Type Parameters:
      T - type of the sets
      Parameters:
      set1 - First set
      set2 - Second set
      Returns:
      a new Set, containing the intersection of the 2 sets.
    • union

      public static <T> Set<T> union(Set<T> set1, Set<T> set2)
      Create union of 2 sets.
      Type Parameters:
      T - type of the sets
      Parameters:
      set1 - First set
      set2 - Second set
      Returns:
      a new Set, containing the union of the 2 sets.
    • diff

      public static <T> Set<T> diff(Set<T> set1, Set<T> set2)
      Create difference of the 2 sets.
      Type Parameters:
      T - type of the sets
      Parameters:
      set1 - First set
      set2 - Second set
      Returns:
      a new Set, containing the set1 - set2.
    • isSubset

      public static <T> boolean isSubset(Set<T> set1, Set<T> set2)
      Determines if set1 is a subset of set2.
      Type Parameters:
      T - type of the sets
      Parameters:
      set1 - First set
      set2 - Second set
      Returns:
      true if set1 is subset of set2, otherwise false.
    • isSuperset

      public static <T> boolean isSuperset(Set<T> set1, Set<T> set2)
      Determines if set1 is a superset of set2.
      Type Parameters:
      T - type of the sets
      Parameters:
      set1 - First set
      set2 - Second set
      Returns:
      true if set1 is superset of set2, otherwise false.