Class Sets
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.matchers.util.Sets
-
public final class Sets extends java.lang.Object
This class was motivated by the similar Sets class from Guava to provide simple set manipulation functionality. However, as starting with version 2.3 the runtime of VIATRA Query should not depend on Guava, not even internally, the relevant subset of Sets methods will be reimplemented here.The current approach is to delegate to Eclipse Collections wherever possible. Such glue methods are useful so that downstream clients can avoid directly depending on Eclipse Collections.
Without an equivalent from Eclipse Collections,
cartesianProduct(List)
is implemented here from scratch.- Since:
- 2.3
-
-
Constructor Summary
Constructors Constructor Description Sets()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <A> java.util.Set<java.util.List<A>>
cartesianProduct(java.util.List<? extends java.util.Set<? extends A>> setsList)
static <A> java.util.Set<A>
difference(java.util.Set<A> left, java.util.Set<A> right)
static <A> java.util.Set<A>
intersection(java.util.Set<A> left, java.util.Set<A> right)
static <A> java.util.Set<A>
newSet(java.lang.Iterable<A> elements)
static <A> java.util.Set<? extends java.util.Set<A>>
powerSet(java.util.Set<A> set)
static <A> java.util.Set<A>
union(java.util.Set<A> left, java.util.Set<A> right)
-
-
-
Method Detail
-
newSet
public static <A> java.util.Set<A> newSet(java.lang.Iterable<A> elements)
- Since:
- 2.4
-
intersection
public static <A> java.util.Set<A> intersection(java.util.Set<A> left, java.util.Set<A> right)
-
difference
public static <A> java.util.Set<A> difference(java.util.Set<A> left, java.util.Set<A> right)
-
union
public static <A> java.util.Set<A> union(java.util.Set<A> left, java.util.Set<A> right)
-
powerSet
public static <A> java.util.Set<? extends java.util.Set<A>> powerSet(java.util.Set<A> set)
-
cartesianProduct
public static <A> java.util.Set<java.util.List<A>> cartesianProduct(java.util.List<? extends java.util.Set<? extends A>> setsList)
-
-