Class CollectionHelper
java.lang.Object
tools.refinery.interpreter.rete.itc.alg.util.CollectionHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic <V> Set
<V> difference
(Set<V> set1, Set<V> set2) Returns the difference of two sets (S1\S2).static <V> Set
<V> intersection
(Set<V> set1, Set<V> set2) Returns the intersection of two sets.
-
Method Details
-
intersection
Returns the intersection of two sets. It callsSet.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
Returns the difference of two sets (S1\S2). It callsSet.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
-