Top Description Constructors Methods
org.eclipse.collections.impl.utility.internal

public final Class SetIterables

extends Object
Class Inheritance
Imports
java.util.Set, org.eclipse.collections.api.LazyIterable, org.eclipse.collections.api.block.function.Function2, org.eclipse.collections.api.factory.Sets, org.eclipse.collections.api.set.ImmutableSet, .MutableSet, .SetIterable, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.set.mutable.UnifiedSet, org.eclipse.collections.impl.set.strategy.mutable.UnifiedSetWithHashingStrategy, org.eclipse.collections.impl.tuple.Tuples, org.eclipse.collections.impl.utility.Iterate, .LazyIterate

Set algebra operations.

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.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static <A, B> LazyIterable<Pair<A, B>>
public static <A, B, C> LazyIterable<C>
cartesianProduct(SetIterable<A> set1, SetIterable<B> set2, Function2<A, B, C> function)

public static <E> MutableSet<E>
difference(SetIterable<? extends E> minuendSet, SetIterable<? extends E> subtrahendSet)

public static <E, R extends Set<E>> R
differenceInto(SetIterable<? extends E> minuendSet, SetIterable<? extends E> subtrahendSet, R targetSet)

public static <T> ImmutableSet<ImmutableSet<T>>
immutablePowerSet(Set<T> set)

Returns an Immutable version of powerset where the inner sets are also immutable.

public static <E> MutableSet<E>
intersect(SetIterable<? extends E> setA, SetIterable<? extends E> setB)

public static <E, R extends Set<E>> R
intersectInto(SetIterable<? extends E> setA, SetIterable<? extends E> setB, R targetSet)

public static <E> boolean
isProperSubsetOf(SetIterable<? extends E> candidateSubset, SetIterable<? extends E> candidateSuperset)

public static <E> boolean
isSubsetOf(SetIterable<? extends E> candidateSubset, SetIterable<? extends E> candidateSuperset)

public static <T> MutableSet<MutableSet<T>>
powerSet(Set<T> set)

public static <T> MutableSet<MutableSet<T>>
private static <T> MutableSet<MutableSet<T>>
public static <E> MutableSet<E>
symmetricDifference(SetIterable<? extends E> setA, SetIterable<? extends E> setB)

public static <E, R extends Set<E>> R
symmetricDifferenceInto(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 Set<E>> R
unionInto(SetIterable<? extends E> setA, SetIterable<? extends E> setB, R targetSet)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SetIterablesback to summary
private SetIterables()

Method Detail

cartesianProductback to summary
public static <A, B> LazyIterable<Pair<A, B>> cartesianProduct(SetIterable<A> set1, SetIterable<B> set2)
cartesianProductback to summary
public static <A, B, C> LazyIterable<C> cartesianProduct(SetIterable<A> set1, SetIterable<B> set2, Function2<A, B, C> function)
differenceback to summary
public static <E> MutableSet<E> difference(SetIterable<? extends E> minuendSet, SetIterable<? extends E> subtrahendSet)
differenceIntoback to summary
public static <E, R extends Set<E>> R differenceInto(SetIterable<? extends E> minuendSet, SetIterable<? extends E> subtrahendSet, R targetSet)
immutablePowerSetback to summary
public static <T> ImmutableSet<ImmutableSet<T>> immutablePowerSet(Set<T> set)

Returns an Immutable version of powerset where the inner sets are also immutable.

intersectback to summary
public static <E> MutableSet<E> intersect(SetIterable<? extends E> setA, SetIterable<? extends E> setB)
intersectIntoback to summary
public static <E, R extends Set<E>> R intersectInto(SetIterable<? extends E> setA, SetIterable<? extends E> setB, R targetSet)
isProperSubsetOfback to summary
public static <E> boolean isProperSubsetOf(SetIterable<? extends E> candidateSubset, SetIterable<? extends E> candidateSuperset)
isSubsetOfback to summary
public static <E> boolean isSubsetOf(SetIterable<? extends E> candidateSubset, SetIterable<? extends E> candidateSuperset)
powerSetback to summary
public static <T> MutableSet<MutableSet<T>> powerSet(Set<T> set)
powerSetback to summary
public static <T> MutableSet<MutableSet<T>> powerSet(UnifiedSetWithHashingStrategy<T> set)
powerSetWithSeedback to summary
private static <T> MutableSet<MutableSet<T>> powerSetWithSeed(Set<T> set, MutableSet<MutableSet<T>> seed)
symmetricDifferenceback to summary
public static <E> MutableSet<E> symmetricDifference(SetIterable<? extends E> setA, SetIterable<? extends E> setB)
symmetricDifferenceIntoback to summary
public static <E, R extends Set<E>> R symmetricDifferenceInto(SetIterable<? extends E> setA, SetIterable<? extends E> setB, R targetSet)
unionback to summary
public static <E> MutableSet<E> union(SetIterable<? extends E> setA, SetIterable<? extends E> setB)
unionIntoback to summary
public static <E, R extends Set<E>> R unionInto(SetIterable<? extends E> setA, SetIterable<? extends E> setB, R targetSet)