@Override public void forEachKeyValue(Procedure2<? super K, ? super V> procedure2) { synchronized (this.lock) { this.getDelegate().forEachKeyValue(procedure2); } }
@Override public void forEachKeyValue(Procedure2<? super K, ? super V> procedure2) { synchronized (this.lock) { this.getDelegate().forEachKeyValue(procedure2); } }
(r1, r2) -> r2.forEachKeyValue((key, value) ->
(r1, r2) -> r2.forEachKeyValue((key, value) ->
/** * Groups the elements using the {@code groupBy} function and all the elements that map to the same key are * aggregated together using the {@code aggregator} function. The second parameter, the {@code zeroValueFactory} * function, creates the initial value in each aggregation. Aggregate results are allowed to be immutable as they * will be replaced in the map. */ public static <T, K, R extends MutableMapIterable<K, T>> Collector<T, ?, R> aggregateBy( Function<? super T, ? extends K> groupBy, Function0<? extends T> zeroValueFactory, Function2<? super T, ? super T, ? extends T> aggregator, Supplier<R> supplier) { return Collector.of( supplier, (map, each) -> { map.updateValueWith(groupBy.valueOf(each), zeroValueFactory, aggregator, each); }, (r1, r2) -> { r2.forEachKeyValue((key, value) -> r1.updateValueWith(key, zeroValueFactory, aggregator, value)); return r1; }, EMPTY_CHARACTERISTICS); }
/** * Groups the elements using the {@code groupBy} function and all the elements that map to the same key are * aggregated together using the {@code aggregator} function. The second parameter, the {@code zeroValueFactory} * function, creates the initial value in each aggregation. Aggregate results are allowed to be immutable as they * will be replaced in the map. */ public static <T, K, R extends MutableMapIterable<K, T>> Collector<T, ?, R> aggregateBy( Function<? super T, ? extends K> groupBy, Function0<? extends T> zeroValueFactory, Function2<? super T, ? super T, ? extends T> aggregator, Supplier<R> supplier) { return Collector.of( supplier, (map, each) -> { map.updateValueWith(groupBy.valueOf(each), zeroValueFactory, aggregator, each); }, (r1, r2) -> { r2.forEachKeyValue((key, value) -> r1.updateValueWith(key, zeroValueFactory, aggregator, value)); return r1; }, EMPTY_CHARACTERISTICS); }
@Override public void forEachKeyValue(Procedure2<? super K, ? super V> procedure2) { synchronized (this.lock) { this.getDelegate().forEachKeyValue(procedure2); } }
/** * Groups the elements using the {@code groupBy} function and all the elements that map to the same key are * aggregated together using the {@code aggregator} function. The second parameter, the {@code zeroValueFactory} * function, creates the initial value in each aggregation. Aggregate results are allowed to be immutable as they * will be replaced in the map. */ public static <T, K, R extends MutableMapIterable<K, T>> Collector<T, ?, R> aggregateBy( Function<? super T, ? extends K> groupBy, Function0<? extends T> zeroValueFactory, Function2<? super T, ? super T, ? extends T> aggregator, Supplier<R> supplier) { return Collector.of( supplier, (map, each) -> { map.updateValueWith(groupBy.valueOf(each), zeroValueFactory, aggregator, each); }, (r1, r2) -> { r2.forEachKeyValue((key, value) -> r1.updateValueWith(key, zeroValueFactory, aggregator, value)); return r1; }, EMPTY_CHARACTERISTICS); }