Class SetOperations
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.vilTypes.SetOperations
-
public class SetOperations extends java.lang.ObjectSpecific reusable operations for sets.- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Constructor Description SetOperations()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> java.util.Set<T>difference(Set<T> s1, Set<T> s2)Calculates the difference between the given two sets, i.e., the elements ofs1that are not ins2.private static <T> java.util.Set<T>difference(Set<T> s1, Set<T> s2, java.util.Set<T> result)Calculates the difference between the given two sets, i.e., the elements ofs1that are not ins2.static <T> java.util.Set<T>symmetricDifference(Set<T> s1, Set<T> s2)Calculates the symmetric difference between the given two sets, i.e., the elements that are either ins1or ins2but not in both.
-
-
-
Method Detail
-
difference
public static <T> java.util.Set<T> difference(Set<T> s1, Set<T> s2)
Calculates the difference between the given two sets, i.e., the elements ofs1that are not ins2.- Type Parameters:
T- the element type- Parameters:
s1- the first sets2- the second set- Returns:
- the set difference
-
difference
private static <T> java.util.Set<T> difference(Set<T> s1, Set<T> s2, java.util.Set<T> result)
Calculates the difference between the given two sets, i.e., the elements ofs1that are not ins2.- Type Parameters:
T- the element type- Parameters:
s1- the first sets2- the second setresult- the result set (a new one is created if null)- Returns:
- the set difference in terms of
resultor the new set created
-
symmetricDifference
public static <T> java.util.Set<T> symmetricDifference(Set<T> s1, Set<T> s2)
Calculates the symmetric difference between the given two sets, i.e., the elements that are either ins1or ins2but not in both.- Type Parameters:
T- the element type- Parameters:
s1- the first sets2- the second set- Returns:
- the symmetric set difference
-
-