org.eclipse.incquery.runtime.base.itc.alg.incscc

## Class CollectionHelper

- java.lang.Object
- - org.eclipse.incquery.runtime.base.itc.alg.incscc.CollectionHelper

-     public class CollectionHelper
      extends java.lang.Object

  Author:
    Tamas Szabo

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CollectionHelper()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <V> java.util.Set<V>` | `difference(java.util.Set<V> set1, java.util.Set<V> set2)` Returns the difference of two sets (S1\S2).
    `static <V> java.util.Set<V>` | `intersection(java.util.Set<V> set1, java.util.Set<V> set2)` Returns the intersection of two sets.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CollectionHelper

          public CollectionHelper()

  - ### Method Detail

    - #### intersection

          public static <V> java.util.Set<V> intersection(java.util.Set<V> set1,
                                                          java.util.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
        `set2` - the second set
      Returns:
        the intersection of the sets

    - #### difference

          public static <V> java.util.Set<V> difference(java.util.Set<V> set1,
                                                        java.util.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
        `set2` - the second set
      Returns:
        the difference of the sets