/** * A parallel form of forEachKeyValue. * * @see MapIterate#forEachKeyValue(Map, Procedure2) * @see ParallelIterate */ public static <K, V> void forEachKeyValue( Map<K, V> map, Procedure2<? super K, ? super V> procedure, int minForkSize, int taskCount, Executor executor) { if (map.size() > minForkSize) { Procedure<Pair<K, V>> pairProcedure = new PairProcedure<>(procedure); ParallelIterate.forEachInListOnExecutor( MapIterate.toListOfPairs(map), new PassThruProcedureFactory<>(pairProcedure), new PassThruCombiner<>(), minForkSize, taskCount, executor); } else { MapIterate.forEachKeyValue(map, procedure); } }
/** * A parallel form of forEachKeyValue. * * @see MapIterate#forEachKeyValue(Map, Procedure2) * @see ParallelIterate */ public static <K, V> void forEachKeyValue( Map<K, V> map, Procedure2<? super K, ? super V> procedure, int minForkSize, int taskCount, Executor executor) { if (map.size() > minForkSize) { Procedure<Pair<K, V>> pairProcedure = new PairProcedure<>(procedure); ParallelIterate.forEachInListOnExecutor( MapIterate.toListOfPairs(map), new PassThruProcedureFactory<>(pairProcedure), new PassThruCombiner<>(), minForkSize, taskCount, executor); } else { MapIterate.forEachKeyValue(map, procedure); } }
&& iterable instanceof List) ParallelIterate.forEachInListOnExecutor( (List<T>) iterable, procedureFactory,
&& iterable instanceof List) ParallelIterate.forEachInListOnExecutor( (List<T>) iterable, procedureFactory,
/** * A parallel form of forEachKeyValue. * * @see MapIterate#forEachKeyValue(Map, Procedure2) * @see ParallelIterate */ public static <K, V> void forEachKeyValue( Map<K, V> map, Procedure2<? super K, ? super V> procedure, int minForkSize, int taskCount, Executor executor) { if (map.size() > minForkSize) { Procedure<Pair<K, V>> pairProcedure = new PairProcedure<>(procedure); ParallelIterate.forEachInListOnExecutor( MapIterate.toListOfPairs(map), new PassThruProcedureFactory<>(pairProcedure), new PassThruCombiner<>(), minForkSize, taskCount, executor); } else { MapIterate.forEachKeyValue(map, procedure); } }
&& iterable instanceof List) ParallelIterate.forEachInListOnExecutor( (List<T>) iterable, procedureFactory,