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>
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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <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)booleanallSatisfy(Predicate<? super T> predicate)<P> booleanallSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)booleananySatisfy(Predicate<? super T> predicate)<P> booleananySatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)default voidappendString(Appendable appendable)default voidappendString(Appendable appendable, String separator)voidappendString(Appendable appendable, String start, String separator, String end)ParallelIterable<T>asUnique()<V> ParallelIterable<V>collect(Function<? super T,? extends V> function)Creates a parallel iterable for collecting elements from the current iterable.<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.<P,V>
ParallelIterable<V>collectWith(Function2<? super T,? super P,? extends V> function, P parameter)intcount(Predicate<? super T> predicate)<P> intcountWith(Predicate2<? super T,? super P> predicate, P parameter)Tdetect(Predicate<? super T> predicate)TdetectIfNone(Predicate<? super T> predicate, Function0<? extends T> function)<P> TdetectWith(Predicate2<? super T,? super P> predicate, P parameter)<P> TdetectWithIfNone(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.voidforEach(Procedure<? super T> procedure)<P> voidforEachWith(Procedure2<? super T,? super P> procedure, P parameter)<V> Multimap<V,T>groupBy(Function<? super T,? extends V> function)<V> Multimap<V,T>groupByEach(Function<? super T,? extends Iterable<V>> function)<V> MapIterable<V,T>groupByUniqueKey(Function<? super T,? extends V> function)default StringmakeString()default StringmakeString(String separator)default StringmakeString(String start, String separator, String end)default StringmakeString(Function<? super T,Object> function, String start, String separator, String end)Tmax()Tmax(Comparator<? super T> comparator)<V extends Comparable<? super V>>
TmaxBy(Function<? super T,? extends V> function)Tmin()Tmin(Comparator<? super T> comparator)<V extends Comparable<? super V>>
TminBy(Function<? super T,? extends V> function)booleannoneSatisfy(Predicate<? super T> predicate)<P> booleannoneSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)ParallelIterable<T>reject(Predicate<? super T> predicate)Creates a parallel iterable for rejecting elements from the current iterable.<P> ParallelIterable<T>rejectWith(Predicate2<? super T,? super P> predicate, P parameter)ParallelIterable<T>select(Predicate<? super T> predicate)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)doublesumOfDouble(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.doublesumOfFloat(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.longsumOfInt(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.longsumOfLong(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)MutableBag<T>toBag()MutableList<T>toList()<NK,NV>
MutableMap<NK,NV>toMap(Function<? super T,? extends NK> keyFunction, Function<? super T,? extends NV> valueFunction)MutableSet<T>toSet()MutableSortedBag<T>toSortedBag()MutableSortedBag<T>toSortedBag(Comparator<? super T> comparator)<V extends Comparable<? super V>>
MutableSortedBag<T>toSortedBagBy(Function<? super T,? extends V> function)default MutableList<T>toSortedList()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)MutableSortedSet<T>toSortedSet()MutableSortedSet<T>toSortedSet(Comparator<? super T> comparator)<V extends Comparable<? super V>>
MutableSortedSet<T>toSortedSetBy(Function<? super T,? extends V> function)
-
-
-
Method Detail
-
asUnique
ParallelIterable<T> asUnique()
-
select
ParallelIterable<T> select(Predicate<? super T> predicate)
Creates a parallel iterable for selecting elements from the current iterable.
-
selectWith
<P> ParallelIterable<T> selectWith(Predicate2<? super T,? super P> predicate, P parameter)
-
selectInstancesOf
<S> ParallelIterable<S> selectInstancesOf(Class<S> clazz)
-
reject
ParallelIterable<T> reject(Predicate<? super T> predicate)
Creates a parallel iterable for rejecting elements from the current iterable.
-
rejectWith
<P> ParallelIterable<T> rejectWith(Predicate2<? super T,? super P> predicate, P parameter)
-
collect
<V> ParallelIterable<V> collect(Function<? super T,? extends V> function)
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
<V> ParallelIterable<V> flatCollect(Function<? super T,? extends Iterable<V>> function)
Creates a parallel flattening iterable for the current iterable.
-
forEachWith
<P> void forEachWith(Procedure2<? super T,? super P> procedure, P parameter)
-
detectWith
<P> T detectWith(Predicate2<? super T,? super P> predicate, P parameter)
-
detectWithIfNone
<P> T detectWithIfNone(Predicate2<? super T,? super P> predicate, P parameter, Function0<? extends T> function)
-
countWith
<P> int countWith(Predicate2<? super T,? super P> predicate, P parameter)
-
anySatisfyWith
<P> boolean anySatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
-
allSatisfyWith
<P> boolean allSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
-
noneSatisfyWith
<P> boolean noneSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
-
toList
MutableList<T> toList()
-
toSortedList
default MutableList<T> toSortedList()
-
toSortedList
MutableList<T> toSortedList(Comparator<? super T> comparator)
-
toSortedListBy
<V extends Comparable<? super V>> MutableList<T> toSortedListBy(Function<? super T,? extends V> function)
-
toSet
MutableSet<T> toSet()
-
toSortedSet
MutableSortedSet<T> toSortedSet()
-
toSortedSet
MutableSortedSet<T> toSortedSet(Comparator<? super T> comparator)
-
toSortedSetBy
<V extends Comparable<? super V>> MutableSortedSet<T> toSortedSetBy(Function<? super T,? extends V> function)
-
toBag
MutableBag<T> toBag()
-
toSortedBag
MutableSortedBag<T> toSortedBag()
-
toSortedBag
MutableSortedBag<T> toSortedBag(Comparator<? super T> comparator)
-
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
default Object[] toArray()
-
toArray
<T1> T1[] toArray(T1[] target)
-
min
T min(Comparator<? super T> comparator)
-
max
T max(Comparator<? super T> comparator)
-
min
T min()
-
max
T max()
-
minBy
<V extends Comparable<? super V>> T minBy(Function<? super T,? extends V> function)
-
maxBy
<V extends Comparable<? super V>> T maxBy(Function<? super T,? extends V> function)
-
sumOfInt
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
-
sumOfFloat
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
-
sumOfLong
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
-
sumOfDouble
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
-
makeString
default String makeString()
-
makeString
default String makeString(Function<? super T,Object> function, String start, String separator, String end)
-
appendString
default void appendString(Appendable appendable)
-
appendString
default void appendString(Appendable appendable, String separator)
-
appendString
void appendString(Appendable appendable, String start, String separator, String end)
-
groupByUniqueKey
<V> MapIterable<V,T> groupByUniqueKey(Function<? super T,? extends V> function)
-
aggregateInPlaceBy
<K,V> MapIterable<K,V> aggregateInPlaceBy(Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V,? super T> mutatingAggregator)
-
-