public final class SetIterables
extends java.lang.Object
Most operations are non-destructive, i.e. no input sets are modified during execution. The exception is operations ending in "Into." These accept the target collection of the final calculation as the first parameter.
Modifier and Type | Method | Description |
---|---|---|
static <A,B> LazyIterable<Pair<A,B>> |
cartesianProduct(SetIterable<A> set1,
SetIterable<B> set2) |
|
static <A,B,C> LazyIterable<C> |
cartesianProduct(SetIterable<A> set1,
SetIterable<B> set2,
Function2<A,B,C> function) |
|
static <E> MutableSet<E> |
difference(SetIterable<? extends E> minuendSet,
SetIterable<? extends E> subtrahendSet) |
|
static <E,R extends java.util.Set<E>> |
differenceInto(SetIterable<? extends E> minuendSet,
SetIterable<? extends E> subtrahendSet,
R targetSet) |
|
static <T> ImmutableSet<ImmutableSet<T>> |
immutablePowerSet(java.util.Set<T> set) |
Returns an Immutable version of powerset where the inner sets are also immutable.
|
static <E> MutableSet<E> |
intersect(SetIterable<? extends E> setA,
SetIterable<? extends E> setB) |
|
static <E,R extends java.util.Set<E>> |
intersectInto(SetIterable<? extends E> setA,
SetIterable<? extends E> setB,
R targetSet) |
|
static <E> boolean |
isProperSubsetOf(SetIterable<? extends E> candidateSubset,
SetIterable<? extends E> candidateSuperset) |
|
static <E> boolean |
isSubsetOf(SetIterable<? extends E> candidateSubset,
SetIterable<? extends E> candidateSuperset) |
|
static <T> MutableSet<MutableSet<T>> |
powerSet(java.util.Set<T> set) |
|
static <T> MutableSet<MutableSet<T>> |
powerSet(UnifiedSetWithHashingStrategy<T> set) |
|
static <E> MutableSet<E> |
symmetricDifference(SetIterable<? extends E> setA,
SetIterable<? extends E> setB) |
|
static <E,R extends java.util.Set<E>> |
symmetricDifferenceInto(SetIterable<? extends E> setA,
SetIterable<? extends E> setB,
R targetSet) |
|
static <E> MutableSet<E> |
union(SetIterable<? extends E> setA,
SetIterable<? extends E> setB) |
|
static <E,R extends java.util.Set<E>> |
unionInto(SetIterable<? extends E> setA,
SetIterable<? extends E> setB,
R targetSet) |
public static <E> MutableSet<E> union(SetIterable<? extends E> setA, SetIterable<? extends E> setB)
public static <E,R extends java.util.Set<E>> R unionInto(SetIterable<? extends E> setA, SetIterable<? extends E> setB, R targetSet)
public static <E> MutableSet<E> intersect(SetIterable<? extends E> setA, SetIterable<? extends E> setB)
public static <E,R extends java.util.Set<E>> R intersectInto(SetIterable<? extends E> setA, SetIterable<? extends E> setB, R targetSet)
public static <E> MutableSet<E> difference(SetIterable<? extends E> minuendSet, SetIterable<? extends E> subtrahendSet)
public static <E,R extends java.util.Set<E>> R differenceInto(SetIterable<? extends E> minuendSet, SetIterable<? extends E> subtrahendSet, R targetSet)
public static <E> MutableSet<E> symmetricDifference(SetIterable<? extends E> setA, SetIterable<? extends E> setB)
public static <E,R extends java.util.Set<E>> R symmetricDifferenceInto(SetIterable<? extends E> setA, SetIterable<? extends E> setB, R targetSet)
public static <E> boolean isSubsetOf(SetIterable<? extends E> candidateSubset, SetIterable<? extends E> candidateSuperset)
public static <E> boolean isProperSubsetOf(SetIterable<? extends E> candidateSubset, SetIterable<? extends E> candidateSuperset)
public static <T> MutableSet<MutableSet<T>> powerSet(java.util.Set<T> set)
public static <T> MutableSet<MutableSet<T>> powerSet(UnifiedSetWithHashingStrategy<T> set)
public static <T> ImmutableSet<ImmutableSet<T>> immutablePowerSet(java.util.Set<T> set)
public static <A,B> LazyIterable<Pair<A,B>> cartesianProduct(SetIterable<A> set1, SetIterable<B> set2)
public static <A,B,C> LazyIterable<C> cartesianProduct(SetIterable<A> set1, SetIterable<B> set2, Function2<A,B,C> function)
Copyright © 2004–2018. All rights reserved.