@Override public void combineOne(SumByBigIntegerProcedure<T, V> thingToCombine) { if (this.result.isEmpty()) { this.result.putAll(thingToCombine.getResult()); } else { thingToCombine.getResult().forEachKeyValue((key, value) -> this.result.updateValue(key, Functions0.zeroBigInteger(), original -> original.add(value))); } } }
/** * @since 6.0 */ public static <V, T> MutableMap<V, BigInteger> sumByBigInteger(Iterable<T> iterable, Function<T, V> groupBy, Function<? super T, BigInteger> function) { MutableMap<V, BigInteger> result = UnifiedMap.newMap(); ParallelIterate.forEach( iterable, new SumByBigIntegerProcedure<>(groupBy, function), new SumByBigIntegerCombiner<>(result), ParallelIterate.DEFAULT_MIN_FORK_SIZE, ParallelIterate.EXECUTOR_SERVICE); return result; }
@Override public void combineOne(SumByBigIntegerProcedure<T, V> thingToCombine) { if (this.result.isEmpty()) { this.result.putAll(thingToCombine.getResult()); } else { thingToCombine.getResult().forEachKeyValue((key, value) -> this.result.updateValue(key, Functions0.zeroBigInteger(), original -> original.add(value))); } } }
@Override public SumByBigIntegerProcedure<T, V> create() { return new SumByBigIntegerProcedure<>(this.groupBy, this.function); } }
/** * @since 6.0 */ public static <V, T> MutableMap<V, BigInteger> sumByBigInteger( Iterable<T> iterable, Function<? super T, ? extends V> groupBy, Function<? super T, BigInteger> function) { MutableMap<V, BigInteger> result = UnifiedMap.newMap(); ParallelIterate.forEach( iterable, new SumByBigIntegerProcedure<>(groupBy, function), new SumByBigIntegerCombiner<>(result), ParallelIterate.DEFAULT_MIN_FORK_SIZE, ParallelIterate.EXECUTOR_SERVICE); return result; }
/** * @since 6.0 */ public static <V, T> MutableMap<V, BigInteger> sumByBigInteger( Iterable<T> iterable, Function<? super T, ? extends V> groupBy, Function<? super T, BigInteger> function) { MutableMap<V, BigInteger> result = UnifiedMap.newMap(); ParallelIterate.forEach( iterable, new SumByBigIntegerProcedure<>(groupBy, function), new SumByBigIntegerCombiner<>(result), ParallelIterate.DEFAULT_MIN_FORK_SIZE, ParallelIterate.EXECUTOR_SERVICE); return result; }
@Override public void combineOne(SumByBigIntegerProcedure<T, V> thingToCombine) { if (this.result.isEmpty()) { this.result.putAll(thingToCombine.getResult()); } else { thingToCombine.getResult().forEachKeyValue((key, value) -> this.result.updateValue(key, Functions0.zeroBigInteger(), original -> original.add(value))); } } }
@Override public SumByBigIntegerProcedure<T, V> create() { return new SumByBigIntegerProcedure<>(this.groupBy, this.function); } }
@Override public SumByBigIntegerProcedure<T, V> create() { return new SumByBigIntegerProcedure<>(this.groupBy, this.function); } }