@Override public void writeExternal(ObjectOutput out) throws IOException { out.writeInt(this.map.size()); try { this.map.forEachKeyValue(new CheckedProcedure2<K, V>() { public void safeValue(K key, V value) throws IOException { out.writeObject(key); out.writeObject(value); } }); } catch (RuntimeException e) { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw e; } }
@Override public void writeExternal(ObjectOutput out) throws IOException { out.writeInt(this.map.size()); try { this.map.forEachKeyValue(new CheckedProcedure2<K, V>() { public void safeValue(K key, V value) throws IOException { out.writeObject(key); out.writeObject(value); } }); } catch (RuntimeException e) { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw e; } }
public void writeExternal(ObjectOutput out) throws IOException { int keysCount = this.mapToWrite.size(); out.writeInt(keysCount); this.mapToWrite.forEachKeyValue(new MultimapKeyValuesSerializingProcedure<>(out)); }
public void writeExternal(ObjectOutput out) throws IOException { int keysCount = this.mapToWrite.size(); out.writeInt(keysCount); this.mapToWrite.forEachKeyValue(new MultimapKeyValuesSerializingProcedure<>(out)); }
@Override public void writeExternal(ObjectOutput out) throws IOException { int keysCount = this.map.size(); out.writeInt(keysCount); this.map.forEachKeyValue(new CheckedProcedure2<K, ImmutableBag<V>>() { public void safeValue(K key, ImmutableBag<V> bag) throws IOException { out.writeObject(key); out.writeInt(bag.sizeDistinct()); bag.forEachWithOccurrences(new CheckedObjectIntProcedure<V>() { public void safeValue(V value, int count) throws IOException { out.writeObject(value); out.writeInt(count); } }); } }); } }
@Override public void writeExternal(ObjectOutput out) throws IOException { int keysCount = this.map.size(); out.writeInt(keysCount); this.map.forEachKeyValue(new CheckedProcedure2<K, ImmutableBag<V>>() { public void safeValue(K key, ImmutableBag<V> bag) throws IOException { out.writeObject(key); out.writeInt(bag.sizeDistinct()); bag.forEachWithOccurrences(new CheckedObjectIntProcedure<V>() { public void safeValue(V value, int count) throws IOException { out.writeObject(value); out.writeInt(count); } }); } }); } }
@Override public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(this.hashingStrategy); out.writeInt(this.map.size()); try { this.map.forEachKeyValue(new CheckedProcedure2<K, V>() { public void safeValue(K key, V value) throws IOException { out.writeObject(key); out.writeObject(value); } }); } catch (RuntimeException e) { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw e; } }
@Override public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(this.hashingStrategy); out.writeInt(this.map.size()); try { this.map.forEachKeyValue(new CheckedProcedure2<K, V>() { public void safeValue(K key, V value) throws IOException { out.writeObject(key); out.writeObject(value); } }); } catch (RuntimeException e) { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw e; } }
@Override public <R extends Collection<V>> MutableMap<K, R> toMap(Function0<R> collectionFactory) { MutableMap<K, R> result = UnifiedMap.newMap(); this.map.forEachKeyValue((key, iterable) -> { R newCollection = collectionFactory.value(); Iterate.addAllTo(iterable, newCollection); result.put(key, newCollection); }); return result; }
@Override public <R extends Collection<V>> MutableMap<K, R> toMap(Function0<R> collectionFactory) { MutableMap<K, R> result = UnifiedMap.newMap(); this.map.forEachKeyValue((key, iterable) -> { R newCollection = collectionFactory.value(); Iterate.addAllTo(iterable, newCollection); result.put(key, newCollection); }); return result; }
@Override public void writeExternal(ObjectOutput out) throws IOException { int keysCount = this.map.size(); out.writeInt(keysCount); this.map.forEachKeyValue(new CheckedProcedure2<K, ImmutableBag<V>>() { public void safeValue(K key, ImmutableBag<V> bag) throws IOException { out.writeObject(key); out.writeInt(bag.sizeDistinct()); bag.forEachWithOccurrences(new CheckedObjectIntProcedure<V>() { public void safeValue(V value, int count) throws IOException { out.writeObject(value); out.writeInt(count); } }); } }); } }
public void writeExternal(ObjectOutput out) throws IOException { int keysCount = this.mapToWrite.size(); out.writeInt(keysCount); this.mapToWrite.forEachKeyValue(new MultimapKeyValuesSerializingProcedure<>(out)); }
@Override public void writeExternal(ObjectOutput out) throws IOException { out.writeInt(this.map.size()); try { this.map.forEachKeyValue(new CheckedProcedure2<K, V>() { public void safeValue(K key, V value) throws IOException { out.writeObject(key); out.writeObject(value); } }); } catch (RuntimeException e) { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw e; } }
@Override public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(this.hashingStrategy); out.writeInt(this.map.size()); try { this.map.forEachKeyValue(new CheckedProcedure2<K, V>() { public void safeValue(K key, V value) throws IOException { out.writeObject(key); out.writeObject(value); } }); } catch (RuntimeException e) { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw e; } }
public SummaryStatistics<T> merge(SummaryStatistics<T> summaryStatistics) { this.doubleStatisticsMap.forEachKeyValue((key, value) -> value.combine(summaryStatistics.getDoubleStats(key))); this.intStatisticsMap.forEachKeyValue((key, value) -> value.combine(summaryStatistics.getIntStats(key))); this.longStatisticsMap.forEachKeyValue((key, value) -> value.combine(summaryStatistics.getLongStats(key))); return this; }
@Override public void value(T each) { this.intStatisticsMap.forEachKeyValue((key, value) -> value.accept(this.intFunctionsMap.get(key).intValueOf(each))); this.longStatisticsMap.forEachKeyValue((key, value) -> value.accept(this.longFunctionsMap.get(key).longValueOf(each))); this.doubleStatisticsMap.forEachKeyValue((key, value) -> value.accept(this.doubleFunctionsMap.get(key).doubleValueOf(each))); }
@Override public <R extends Collection<V>> MutableMap<K, R> toMap(Function0<R> collectionFactory) { MutableMap<K, R> result = UnifiedMap.newMap(); this.map.forEachKeyValue((key, iterable) -> { R newCollection = collectionFactory.value(); Iterate.addAllTo(iterable, newCollection); result.put(key, newCollection); }); return result; }