Package org.eclipse.collections.api
Interface ParallelIterable<T>
- All Known Subinterfaces:
ParallelBag<T>
,ParallelListIterable<T>
,ParallelSetIterable<T>
,ParallelSortedBag<T>
,ParallelSortedSetIterable<T>
,ParallelUnsortedBag<T>
,ParallelUnsortedSetIterable<T>
- All Known Implementing Classes:
AbstractMultiReaderParallelIterable
,AbstractParallelIterable
,AbstractParallelIterableImpl
,AbstractParallelListIterable
,AbstractParallelSortedSetIterable
,AbstractParallelUnsortedBag
,AbstractParallelUnsortedSetIterable
,AbstractSynchronizedParallelIterable
,ListIterableParallelIterable
,MultiReaderParallelIterable
,MultiReaderParallelListIterable
,MultiReaderParallelUnsortedSetIterable
,NonParallelIterable
,NonParallelListIterable
,NonParallelSortedSetIterable
,NonParallelUnsortedBag
,NonParallelUnsortedSetIterable
,ParallelCollectIterable
,ParallelCollectListIterable
,ParallelCollectUnsortedBag
,ParallelDistinctIterable
,ParallelFlatCollectIterable
,ParallelFlatCollectListIterable
,ParallelSelectIterable
,SynchronizedParallelIterable
,SynchronizedParallelListIterable
,SynchronizedParallelSortedSetIterable
,SynchronizedParallelUnsortedSetIterable
public interface ParallelIterable<T>
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 TypeMethodDescription<K,
V> MapIterable<K, V> aggregateBy
(Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Function2<? super V, ? super T, ? extends V> nonMutatingAggregator) <K,
V> MapIterable<K, V> aggregateInPlaceBy
(Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V, ? super T> mutatingAggregator) boolean
allSatisfy
(Predicate<? super T> predicate) <P> boolean
allSatisfyWith
(Predicate2<? super T, ? super P> predicate, P parameter) boolean
anySatisfy
(Predicate<? super T> predicate) <P> boolean
anySatisfyWith
(Predicate2<? super T, ? super P> predicate, P parameter) default void
appendString
(Appendable appendable) default void
appendString
(Appendable appendable, String separator) void
appendString
(Appendable appendable, String start, String separator, String end) asUnique()
<V> ParallelIterable<V>
Creates a parallel iterable for collecting elements from the current iterable.<V> ParallelIterable<V>
Creates a parallel iterable for selecting and collecting elements from the current iterable.<P,
V> ParallelIterable<V> collectWith
(Function2<? super T, ? super P, ? extends V> function, P parameter) int
<P> int
countWith
(Predicate2<? super T, ? super P> predicate, P parameter) detectIfNone
(Predicate<? super T> predicate, Function0<? extends T> function) <P> T
detectWith
(Predicate2<? super T, ? super P> predicate, P parameter) <P> T
detectWithIfNone
(Predicate2<? super T, ? super P> predicate, P parameter, Function0<? extends T> function) <V> ParallelIterable<V>
flatCollect
(Function<? super T, ? extends Iterable<V>> function) Creates a parallel flattening iterable for the current iterable.void
<P> void
forEachWith
(Procedure2<? super T, ? super P> procedure, P parameter) groupByEach
(Function<? super T, ? extends Iterable<V>> function) <V> MapIterable<V,
T> groupByUniqueKey
(Function<? super T, ? extends V> function) default String
default String
makeString
(String separator) default String
makeString
(String start, String separator, String end) max()
max
(Comparator<? super T> comparator) <V extends Comparable<? super V>>
Tmin()
min
(Comparator<? super T> comparator) <V extends Comparable<? super V>>
Tboolean
noneSatisfy
(Predicate<? super T> predicate) <P> boolean
noneSatisfyWith
(Predicate2<? super T, ? super P> predicate, P parameter) Creates a parallel iterable for rejecting elements from the current iterable.<P> ParallelIterable<T>
rejectWith
(Predicate2<? super T, ? super P> predicate, P parameter) Creates a parallel iterable for selecting elements from the current iterable.<S> ParallelIterable<S>
selectInstancesOf
(Class<S> clazz) <P> ParallelIterable<T>
selectWith
(Predicate2<? super T, ? super P> predicate, P parameter) 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.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.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.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.default Object[]
toArray()
<T1> T1[]
toArray
(T1[] target) toBag()
toList()
<NK,
NV> MutableMap<NK, NV> toSet()
toSortedBag
(Comparator<? super T> comparator) <V extends Comparable<? super V>>
MutableSortedBag<T>toSortedBagBy
(Function<? super T, ? extends V> function) default MutableList<T>
toSortedList
(Comparator<? super T> comparator) <V extends Comparable<? super V>>
MutableList<T>toSortedListBy
(Function<? super T, ? extends V> function) <NK,
NV> MutableSortedMap<NK, NV> toSortedMap
(Comparator<? super NK> comparator, Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction) <NK,
NV> MutableSortedMap<NK, NV> toSortedMap
(Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction) toSortedSet
(Comparator<? super T> comparator) <V extends Comparable<? super V>>
MutableSortedSet<T>toSortedSetBy
(Function<? super T, ? extends V> function)
-
Method Details
-
asUnique
ParallelIterable<T> asUnique() -
select
Creates a parallel iterable for selecting elements from the current iterable. -
selectWith
-
selectInstancesOf
-
reject
Creates a parallel iterable for rejecting elements from the current iterable. -
rejectWith
-
collect
Creates a parallel iterable for collecting elements from the current iterable. -
collectWith
<P,V> ParallelIterable<V> collectWith(Function2<? super T, ? super P, ? extends V> function, P parameter) -
collectIf
<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. -
flatCollect
Creates a parallel flattening iterable for the current iterable. -
forEach
-
forEachWith
-
detect
-
detectWith
-
detectIfNone
-
detectWithIfNone
<P> T detectWithIfNone(Predicate2<? super T, ? super P> predicate, P parameter, Function0<? extends T> function) -
count
-
countWith
-
anySatisfy
-
anySatisfyWith
-
allSatisfy
-
allSatisfyWith
-
noneSatisfy
-
noneSatisfyWith
-
toList
MutableList<T> toList() -
toSortedList
-
toSortedList
-
toSortedListBy
<V extends Comparable<? super V>> MutableList<T> toSortedListBy(Function<? super T, ? extends V> function) -
toSet
MutableSet<T> toSet() -
toSortedSet
MutableSortedSet<T> toSortedSet() -
toSortedSet
-
toSortedSetBy
<V extends Comparable<? super V>> MutableSortedSet<T> toSortedSetBy(Function<? super T, ? extends V> function) -
toBag
MutableBag<T> toBag() -
toSortedBag
MutableSortedBag<T> toSortedBag() -
toSortedBag
-
toSortedBagBy
<V extends Comparable<? super V>> MutableSortedBag<T> toSortedBagBy(Function<? super T, ? extends V> function) -
toMap
<NK,NV> MutableMap<NK,NV> toMap(Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction) -
toSortedMap
<NK,NV> MutableSortedMap<NK,NV> toSortedMap(Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction) -
toSortedMap
<NK,NV> MutableSortedMap<NK,NV> toSortedMap(Comparator<? super NK> comparator, Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction) -
toArray
-
toArray
<T1> T1[] toArray(T1[] target) -
min
-
max
-
min
T min() -
max
T max() -
minBy
-
maxBy
-
sumOfInt
Returns the final long result of evaluating function for each element of the iterable in parallel and adding the results together.- Since:
- 6.0
-
sumOfFloat
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
-
sumOfLong
Returns the final long result of evaluating function for each element of the iterable in parallel and adding the results together.- Since:
- 6.0
-
sumOfDouble
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
-
makeString
-
makeString
-
makeString
-
appendString
-
appendString
-
appendString
-
groupBy
-
groupByEach
-
groupByUniqueKey
-
aggregateInPlaceBy
<K,V> MapIterable<K,V> aggregateInPlaceBy(Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V, ? super T> mutatingAggregator) -
aggregateBy
-