Class CollectionHelper

java.lang.Object
tools.refinery.interpreter.rete.itc.alg.util.CollectionHelper

public class CollectionHelper extends Object
  • Method Details

    • intersection

      public static <V> Set<V> intersection(Set<V> set1, Set<V> set2)
      Returns the intersection of two sets. It calls Set.retainAll(java.util.Collection) but returns a new set containing the elements of the intersection.
      Parameters:
      set1 - the first set (can be null, interpreted as empty)
      set2 - the second set (can be null, interpreted as empty)
      Returns:
      the intersection of the sets
      Since:
      1.7
    • difference

      public static <V> Set<V> difference(Set<V> set1, Set<V> set2)
      Returns the difference of two sets (S1\S2). It calls Set.removeAll(java.util.Collection) but returns a new set containing the elements of the difference.
      Parameters:
      set1 - the first set (can be null, interpreted as empty)
      set2 - the second set (can be null, interpreted as empty)
      Returns:
      the difference of the sets
      Since:
      1.7