@Override public void forEachKeyValue(Procedure2<? super K, ? super V> procedure) { this.getDelegate().forEachKeyValue(procedure); }
@Override public void forEachKeyMultiValues(Procedure2<? super K, ? super Iterable<V>> procedure) { this.getMap().forEachKeyValue(procedure); }
@Override public void forEachKeyValue(Procedure2<? super K, ? super V> procedure) { this.getDelegate().forEachKeyValue(procedure); }
@Override public void forEachKeyMultiValues(Procedure2<? super K, ? super Iterable<V>> procedure) { this.getMap().forEachKeyValue(procedure); }
@Override public <K, V> MutableMap<K, V> withMapIterable(MapIterable<? extends K, ? extends V> mapIterable) { MutableMap<K, V> output = Maps.mutable.withInitialCapacity(mapIterable.size()); mapIterable.forEachKeyValue(output::put); return output; } }
public static <K, V> MutableSetMultimap<V, K> flip(MapIterable<K, V> iMap) { MutableSetMultimap<V, K> result = Multimaps.mutable.set.with(); iMap.forEachKeyValue((key, val) -> result.put(val, key)); return result; }
@Override public <K, V> MutableMap<K, V> withMapIterable(MapIterable<? extends K, ? extends V> mapIterable) { MutableMap<K, V> output = Maps.mutable.withInitialCapacity(mapIterable.size()); mapIterable.forEachKeyValue(output::put); return output; } }
public static <K, V> MutableSetMultimap<V, K> flip(MapIterable<K, V> iMap) { MutableSetMultimap<V, K> result = Multimaps.mutable.set.with(); iMap.forEachKeyValue((key, val) -> result.put(val, key)); return result; }
@Override public void forEachKeyValue(Procedure2<? super K, ? super V> procedure) { Procedure2<V, K> innerProcedure = (value, key) -> procedure.value(key, value); this.getMap().forEachKeyValue((key, collection) -> collection.forEachWith(innerProcedure, key)); }
@Override public <V2, R extends MutableMultimap<K, V2>> R collectValues(Function<? super V, ? extends V2> function, R target) { this.getMap().forEachKeyValue((key, collection) -> target.putAll(key, collection.collect(function))); return target; } }
@Override public void forEachKeyValue(Procedure2<? super K, ? super V> procedure) { Procedure2<V, K> innerProcedure = (value, key) -> procedure.value(key, value); this.getMap().forEachKeyValue((key, collection) -> collection.forEachWith(innerProcedure, key)); }
@Override public <V2, R extends MutableMultimap<K, V2>> R collectValues(Function<? super V, ? extends V2> function, R target) { this.getMap().forEachKeyValue((key, collection) -> target.putAll(key, collection.collect(function))); return target; } }
@Override public <R extends MutableMultimap<K, V>> R selectKeysValues(Predicate2<? super K, ? super V> predicate, R target) { this.getMap().forEachKeyValue((key, collection) -> { RichIterable<V> selectedValues = collection.select(value -> predicate.accept(key, value)); target.putAll(key, selectedValues); }); return target; }
@Override public Bag<K> keyBag() { MutableBag<K> bag = Bags.mutable.empty(); this.getMap().forEachKeyValue((key, value) -> bag.addOccurrences(key, value.size())); return bag; }
@Override public Bag<K> keyBag() { MutableBag<K> bag = Bags.mutable.empty(); this.getMap().forEachKeyValue((key, value) -> bag.addOccurrences(key, value.size())); return bag; }
@Override public <R extends MutableMultimap<K, V>> R rejectKeysValues(Predicate2<? super K, ? super V> predicate, R target) { this.getMap().forEachKeyValue((key, collection) -> { RichIterable<V> selectedValues = collection.reject(value -> predicate.accept(key, value)); target.putAll(key, selectedValues); }); return target; }
@Override public <R extends MutableMultimap<K, V>> R rejectKeysValues(Predicate2<? super K, ? super V> predicate, R target) { this.getMap().forEachKeyValue((key, collection) -> { RichIterable<V> selectedValues = collection.reject(value -> predicate.accept(key, value)); target.putAll(key, selectedValues); }); return target; }
@Override public <K2, V2, R extends MutableMultimap<K2, V2>> R collectKeysValues(Function2<? super K, ? super V, Pair<K2, V2>> function, R target) { this.getMap().forEachKeyValue((key, collection) -> collection.each(value -> target.add(function.value(key, value)))); return target; }
@Override public <R extends MutableMultimap<K, V>> R selectKeysValues(Predicate2<? super K, ? super V> predicate, R target) { this.getMap().forEachKeyValue((key, collection) -> { RichIterable<V> selectedValues = collection.select(value -> predicate.accept(key, value)); target.putAll(key, selectedValues); }); return target; }
@Override public <K2, V2, R extends MutableMultimap<K2, V2>> R collectKeysValues(Function2<? super K, ? super V, Pair<K2, V2>> function, R target) { this.getMap().forEachKeyValue((key, collection) -> collection.each(value -> target.add(function.value(key, value)))); return target; }