/** * Same effect as {@link Iterate#collect(Iterable, Function)}, * but executed in parallel batches. * * @return The collected elements. The Collection will be of the same type as the input (List or Set) * and will be in the same order as the input (if it is an ordered collection). * @see ParallelIterate#collect(Iterable, Function, boolean) */ public static <T, V> Collection<V> collect( Iterable<T> iterable, Function<? super T, V> function) { return ParallelIterate.collect(iterable, function, false); }
/** * Same effect as {@link Iterate#collect(Iterable, Function)}, * but executed in parallel batches. * * @return The collected elements. The Collection will be of the same type as the input (List or Set) * and will be in the same order as the input (if it is an ordered collection). * @see ParallelIterate#collect(Iterable, Function, boolean) */ public static <T, V> Collection<V> collect( Iterable<T> iterable, Function<? super T, V> function) { return ParallelIterate.collect(iterable, function, false); }
/** * Same effect as {@link Iterate#collect(Iterable, Function)}, but executed in parallel batches, * and with potentially reordered result. * * @param allowReorderedResult If the result can be in a different order. * Allowing reordering may yield faster execution. * @return The collected elements. The Collection will be of the same type * (List or Set) as the input. */ public static <T, V> Collection<V> collect( Iterable<T> iterable, Function<? super T, V> function, boolean allowReorderedResult) { return ParallelIterate.collect(iterable, function, null, allowReorderedResult); }
/** * Same effect as {@link Iterate#collect(Iterable, Function)}, but executed in parallel batches, * and with potentially reordered result. * * @param allowReorderedResult If the result can be in a different order. * Allowing reordering may yield faster execution. * @return The collected elements. The Collection will be of the same type * (List or Set) as the input. */ public static <T, V> Collection<V> collect( Iterable<T> iterable, Function<? super T, V> function, boolean allowReorderedResult) { return ParallelIterate.collect(iterable, function, null, allowReorderedResult); }
/** * Same effect as {@link Iterate#collect(Iterable, Function)}, but executed in parallel batches, * and writing output into the specified collection. * * @param target Where to write the output. * @param allowReorderedResult If the result can be in a different order. * Allowing reordering may yield faster execution. * @return The 'target' collection, with the collected elements added. */ public static <T, V, R extends Collection<V>> R collect( Iterable<T> iterable, Function<? super T, V> function, R target, boolean allowReorderedResult) { return ParallelIterate.collect( iterable, function, target, ParallelIterate.DEFAULT_MIN_FORK_SIZE, ParallelIterate.EXECUTOR_SERVICE, allowReorderedResult); }
/** * Same effect as {@link Iterate#collect(Iterable, Function)}, but executed in parallel batches, * and writing output into the specified collection. * * @param target Where to write the output. * @param allowReorderedResult If the result can be in a different order. * Allowing reordering may yield faster execution. * @return The 'target' collection, with the collected elements added. */ public static <T, V, R extends Collection<V>> R collect( Iterable<T> iterable, Function<? super T, V> function, R target, boolean allowReorderedResult) { return ParallelIterate.collect( iterable, function, target, ParallelIterate.DEFAULT_MIN_FORK_SIZE, ParallelIterate.EXECUTOR_SERVICE, allowReorderedResult); }
/** * Same effect as {@link Iterate#collect(Iterable, Function)}, * but executed in parallel batches. * * @return The collected elements. The Collection will be of the same type as the input (List or Set) * and will be in the same order as the input (if it is an ordered collection). * @see ParallelIterate#collect(Iterable, Function, boolean) */ public static <T, V> Collection<V> collect( Iterable<T> iterable, Function<? super T, V> function) { return ParallelIterate.collect(iterable, function, false); }
/** * Same effect as {@link Iterate#collect(Iterable, Function)}, but executed in parallel batches, * and with potentially reordered result. * * @param allowReorderedResult If the result can be in a different order. * Allowing reordering may yield faster execution. * @return The collected elements. The Collection will be of the same type * (List or Set) as the input. */ public static <T, V> Collection<V> collect( Iterable<T> iterable, Function<? super T, V> function, boolean allowReorderedResult) { return ParallelIterate.collect(iterable, function, null, allowReorderedResult); }
/** * Same effect as {@link Iterate#collect(Iterable, Function)}, but executed in parallel batches, * and writing output into the specified collection. * * @param target Where to write the output. * @param allowReorderedResult If the result can be in a different order. * Allowing reordering may yield faster execution. * @return The 'target' collection, with the collected elements added. */ public static <T, V, R extends Collection<V>> R collect( Iterable<T> iterable, Function<? super T, V> function, R target, boolean allowReorderedResult) { return ParallelIterate.collect( iterable, function, target, ParallelIterate.DEFAULT_MIN_FORK_SIZE, ParallelIterate.EXECUTOR_SERVICE, allowReorderedResult); }