Top Description Methods
org.eclipse.collections.api

public Interface ParallelIterable<T>

Known Direct Subinterfaces
org.eclipse.collections.api.bag.ParallelBag, org.eclipse.collections.api.list.ParallelListIterable, org.eclipse.collections.api.set.ParallelSetIterable
Annotations
@Beta
Imports
java.util.Comparator, org.eclipse.collections.api.annotation.Beta, org.eclipse.collections.api.bag.MutableBag, org.eclipse.collections.api.bag.sorted.MutableSortedBag, org.eclipse.collections.api.block.function.Function, .Function0, .Function2, org.eclipse.collections.api.block.function.primitive.DoubleFunction, .FloatFunction, .IntFunction, .LongFunction, org.eclipse.collections.api.block.predicate.Predicate, .Predicate2, org.eclipse.collections.api.block.procedure.Procedure, .Procedure2, org.eclipse.collections.api.list.MutableList, org.eclipse.collections.api.map.MapIterable, .MutableMap, org.eclipse.collections.api.map.sorted.MutableSortedMap, org.eclipse.collections.api.multimap.Multimap, org.eclipse.collections.api.set.MutableSet, org.eclipse.collections.api.set.sorted.MutableSortedSet

A ParallelIterable is RichIterable which will defer evaluation for certain methods like select, reject, collect, etc. Any methods that do not return a ParallelIterable when called will cause evaluation to be forced. Evaluation occurs in parallel. All code blocks passed in must be stateless or thread-safe.
Since
5.0

Method Summary

Modifier and TypeMethod and Description
public <K, V> MapIterable<K, V>
aggregateBy(Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Function2<? super V, ? super T, ? extends V> nonMutatingAggregator)

public <K, V> MapIterable<K, V>
aggregateInPlaceBy(Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V, ? super T> mutatingAggregator)

public boolean
allSatisfy(Predicate<? super T> predicate)

public <P> boolean
allSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)

public boolean
anySatisfy(Predicate<? super T> predicate)

public <P> boolean
anySatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)

public default void
public default void
appendString(Appendable appendable, String separator)

public void
appendString(Appendable appendable, String start, String separator, String end)

public ParallelIterable<T>
public <V> ParallelIterable<V>
collect(Function<? super T, ? extends V> function)

Creates a parallel iterable for collecting elements from the current iterable.

public <V> ParallelIterable<V>
collectIf(Predicate<? super T> predicate, Function<? super T, ? extends V> function)

Creates a parallel iterable for selecting and collecting elements from the current iterable.

public <P, V> ParallelIterable<V>
collectWith(Function2<? super T, ? super P, ? extends V> function, P parameter)

public int
count(Predicate<? super T> predicate)

public <P> int
countWith(Predicate2<? super T, ? super P> predicate, P parameter)

public T
detect(Predicate<? super T> predicate)

public T
detectIfNone(Predicate<? super T> predicate, Function0<? extends T> function)

public <P> T
detectWith(Predicate2<? super T, ? super P> predicate, P parameter)

public <P> T
detectWithIfNone(Predicate2<? super T, ? super P> predicate, P parameter, Function0<? extends T> function)

public <V> ParallelIterable<V>
flatCollect(Function<? super T, ? extends Iterable<V>> function)

Creates a parallel flattening iterable for the current iterable.

public void
forEach(Procedure<? super T> procedure)

public <P> void
forEachWith(Procedure2<? super T, ? super P> procedure, P parameter)

public <V> Multimap<V, T>
groupBy(Function<? super T, ? extends V> function)

public <V> Multimap<V, T>
groupByEach(Function<? super T, ? extends Iterable<V>> function)

public <V> MapIterable<V, T>
groupByUniqueKey(Function<? super T, ? extends V> function)

public default String
public default String
makeString(String separator)

public default String
makeString(String start, String separator, String end)

public default String
makeString(Function<? super T, Object> function, String start, String separator, String end)

public T
max(Comparator<? super T> comparator)

public T
max()

public <V extends Comparable<? super V>> T
maxBy(Function<? super T, ? extends V> function)

public T
min(Comparator<? super T> comparator)

public T
min()

public <V extends Comparable<? super V>> T
minBy(Function<? super T, ? extends V> function)

public boolean
noneSatisfy(Predicate<? super T> predicate)

public <P> boolean
noneSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)

public ParallelIterable<T>
reject(Predicate<? super T> predicate)

Creates a parallel iterable for rejecting elements from the current iterable.

public <P> ParallelIterable<T>
rejectWith(Predicate2<? super T, ? super P> predicate, P parameter)

public ParallelIterable<T>
select(Predicate<? super T> predicate)

Creates a parallel iterable for selecting elements from the current iterable.

public <S> ParallelIterable<S>
public <P> ParallelIterable<T>
selectWith(Predicate2<? super T, ? super P> predicate, P parameter)

public double
sumOfDouble(DoubleFunction<? super T> function)

Returns the final double result of evaluating function for each element of the iterable in parallel and adding the results together.

public double
sumOfFloat(FloatFunction<? super T> function)

Returns the final double result of evaluating function for each element of the iterable in parallel and adding the results together.

public long
sumOfInt(IntFunction<? super T> function)

Returns the final long result of evaluating function for each element of the iterable in parallel and adding the results together.

public long
sumOfLong(LongFunction<? super T> function)

Returns the final long result of evaluating function for each element of the iterable in parallel and adding the results together.

public default Object[]
public <T1> T1[]
toArray(T1[] target)

public MutableBag<T>
public MutableList<T>
public <NK, NV> MutableMap<NK, NV>
toMap(Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction)

public MutableSet<T>
public MutableSortedBag<T>
public MutableSortedBag<T>
toSortedBag(Comparator<? super T> comparator)

public <V extends Comparable<? super V>> MutableSortedBag<T>
toSortedBagBy(Function<? super T, ? extends V> function)

public default MutableList<T>
public MutableList<T>
toSortedList(Comparator<? super T> comparator)

public <V extends Comparable<? super V>> MutableList<T>
toSortedListBy(Function<? super T, ? extends V> function)

public <NK, NV> MutableSortedMap<NK, NV>
toSortedMap(Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction)

public <NK, NV> MutableSortedMap<NK, NV>
toSortedMap(Comparator<? super NK> comparator, Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction)

public MutableSortedSet<T>
public MutableSortedSet<T>
toSortedSet(Comparator<? super T> comparator)

public <V extends Comparable<? super V>> MutableSortedSet<T>
toSortedSetBy(Function<? super T, ? extends V> function)

Method Detail

aggregateByback to summary
public <K, V> MapIterable<K, V> aggregateBy(Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Function2<? super V, ? super T, ? extends V> nonMutatingAggregator)
aggregateInPlaceByback to summary
public <K, V> MapIterable<K, V> aggregateInPlaceBy(Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V, ? super T> mutatingAggregator)
allSatisfyback to summary
public boolean allSatisfy(Predicate<? super T> predicate)
allSatisfyWithback to summary
public <P> boolean allSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)
anySatisfyback to summary
public boolean anySatisfy(Predicate<? super T> predicate)
anySatisfyWithback to summary
public <P> boolean anySatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)
appendStringback to summary
public default void appendString(Appendable appendable)
appendStringback to summary
public default void appendString(Appendable appendable, String separator)
appendStringback to summary
public void appendString(Appendable appendable, String start, String separator, String end)
asUniqueback to summary
public ParallelIterable<T> asUnique()
collectback to summary
public <V> ParallelIterable<V> collect(Function<? super T, ? extends V> function)

Creates a parallel iterable for collecting elements from the current iterable.

collectIfback to summary
public <V> ParallelIterable<V> collectIf(Predicate<? super T> predicate, Function<? super T, ? extends V> function)

Creates a parallel iterable for selecting and collecting elements from the current iterable.

collectWithback to summary
public <P, V> ParallelIterable<V> collectWith(Function2<? super T, ? super P, ? extends V> function, P parameter)
countback to summary
public int count(Predicate<? super T> predicate)
countWithback to summary
public <P> int countWith(Predicate2<? super T, ? super P> predicate, P parameter)
detectback to summary
public T detect(Predicate<? super T> predicate)
detectIfNoneback to summary
public T detectIfNone(Predicate<? super T> predicate, Function0<? extends T> function)
detectWithback to summary
public <P> T detectWith(Predicate2<? super T, ? super P> predicate, P parameter)
detectWithIfNoneback to summary
public <P> T detectWithIfNone(Predicate2<? super T, ? super P> predicate, P parameter, Function0<? extends T> function)
flatCollectback to summary
public <V> ParallelIterable<V> flatCollect(Function<? super T, ? extends Iterable<V>> function)

Creates a parallel flattening iterable for the current iterable.

forEachback to summary
public void forEach(Procedure<? super T> procedure)
forEachWithback to summary
public <P> void forEachWith(Procedure2<? super T, ? super P> procedure, P parameter)
groupByback to summary
public <V> Multimap<V, T> groupBy(Function<? super T, ? extends V> function)
groupByEachback to summary
public <V> Multimap<V, T> groupByEach(Function<? super T, ? extends Iterable<V>> function)
groupByUniqueKeyback to summary
public <V> MapIterable<V, T> groupByUniqueKey(Function<? super T, ? extends V> function)
makeStringback to summary
public default String makeString()
makeStringback to summary
public default String makeString(String separator)
makeStringback to summary
public default String makeString(String start, String separator, String end)
makeStringback to summary
public default String makeString(Function<? super T, Object> function, String start, String separator, String end)
maxback to summary
public T max(Comparator<? super T> comparator)
maxback to summary
public T max()
maxByback to summary
public <V extends Comparable<? super V>> T maxBy(Function<? super T, ? extends V> function)
minback to summary
public T min(Comparator<? super T> comparator)
minback to summary
public T min()
minByback to summary
public <V extends Comparable<? super V>> T minBy(Function<? super T, ? extends V> function)
noneSatisfyback to summary
public boolean noneSatisfy(Predicate<? super T> predicate)
noneSatisfyWithback to summary
public <P> boolean noneSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)
rejectback to summary
public ParallelIterable<T> reject(Predicate<? super T> predicate)

Creates a parallel iterable for rejecting elements from the current iterable.

rejectWithback to summary
public <P> ParallelIterable<T> rejectWith(Predicate2<? super T, ? super P> predicate, P parameter)
selectback to summary
public ParallelIterable<T> select(Predicate<? super T> predicate)

Creates a parallel iterable for selecting elements from the current iterable.

selectInstancesOfback to summary
public <S> ParallelIterable<S> selectInstancesOf(Class<S> clazz)
selectWithback to summary
public <P> ParallelIterable<T> selectWith(Predicate2<? super T, ? super P> predicate, P parameter)
sumOfDoubleback to summary
public double sumOfDouble(DoubleFunction<? super T> function)

Returns the final double result of evaluating function for each element of the iterable in parallel and adding the results together. It uses Kahan summation algorithm to reduce numerical error.

Since
6.0
sumOfFloatback to summary
public double sumOfFloat(FloatFunction<? super T> function)

Returns the final double result of evaluating function for each element of the iterable in parallel and adding the results together. It uses Kahan summation algorithm to reduce numerical error.

Since
6.0
sumOfIntback to summary
public long sumOfInt(IntFunction<? super T> function)

Returns the final long result of evaluating function for each element of the iterable in parallel and adding the results together.

Since
6.0
sumOfLongback to summary
public long sumOfLong(LongFunction<? super T> function)

Returns the final long result of evaluating function for each element of the iterable in parallel and adding the results together.

Since
6.0
toArrayback to summary
public default Object[] toArray()
toArrayback to summary
public <T1> T1[] toArray(T1[] target)
toBagback to summary
public MutableBag<T> toBag()
toListback to summary
public MutableList<T> toList()
toMapback to summary
public <NK, NV> MutableMap<NK, NV> toMap(Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction)
toSetback to summary
public MutableSet<T> toSet()
toSortedBagback to summary
public MutableSortedBag<T> toSortedBag()
toSortedBagback to summary
public MutableSortedBag<T> toSortedBag(Comparator<? super T> comparator)
toSortedBagByback to summary
public <V extends Comparable<? super V>> MutableSortedBag<T> toSortedBagBy(Function<? super T, ? extends V> function)
toSortedListback to summary
public default MutableList<T> toSortedList()
toSortedListback to summary
public MutableList<T> toSortedList(Comparator<? super T> comparator)
toSortedListByback to summary
public <V extends Comparable<? super V>> MutableList<T> toSortedListBy(Function<? super T, ? extends V> function)
toSortedMapback to summary
public <NK, NV> MutableSortedMap<NK, NV> toSortedMap(Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction)
toSortedMapback to summary
public <NK, NV> MutableSortedMap<NK, NV> toSortedMap(Comparator<? super NK> comparator, Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction)
toSortedSetback to summary
public MutableSortedSet<T> toSortedSet()
toSortedSetback to summary
public MutableSortedSet<T> toSortedSet(Comparator<? super T> comparator)
toSortedSetByback to summary
public <V extends Comparable<? super V>> MutableSortedSet<T> toSortedSetBy(Function<? super T, ? extends V> function)