本文整理了Java中org.eclipse.collections.api.map.MutableMap.forEachKeyValue()
方法的一些代码示例,展示了MutableMap.forEachKeyValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MutableMap.forEachKeyValue()
方法的具体详情如下:
包路径:org.eclipse.collections.api.map.MutableMap
类名称:MutableMap
方法名:forEachKeyValue
暂无
代码示例来源:origin: Vedenin/useful-java-links
@Benchmark
public long test10_UsingEclipseMap() throws IOException {
final long[] i = {0};
mutableMap.forEachKeyValue((key, value) -> {
i[0] += key + value;
});
return i[0];
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public void forEachKeyValue(Procedure2<? super K, ? super V> procedure)
{
this.getMutableMap().forEachKeyValue(procedure);
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public void forEachKeyValue(Procedure2<? super K, ? super V> procedure)
{
this.getMutableMap().forEachKeyValue(procedure);
}
代码示例来源:origin: eclipse/eclipse-collections
public void writeExternal(ObjectOutput out) throws IOException
{
out.writeInt(this.map.size());
this.map.forEachKeyValue(new MultimapKeyValuesSerializingProcedure<>(out));
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public <R extends Collection<V>> MutableMap<K, R> toMap(Function0<R> collectionFactory)
{
MutableMap<K, R> result = (MutableMap<K, R>) this.createMapWithKeyCount(this.map.size());
this.map.forEachKeyValue((key, collection) -> {
R mutableCollection = collectionFactory.value();
mutableCollection.addAll(collection);
result.put(key, mutableCollection);
});
return result;
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public MutableMap<K, RichIterable<V>> toMap()
{
MutableMap<K, RichIterable<V>> result = (MutableMap<K, RichIterable<V>>) (MutableMap<?, ?>) this.map.newEmpty();
this.map.forEachKeyValue((key, collection) -> {
MutableCollection<V> mutableCollection = collection.newEmpty();
mutableCollection.addAll(collection);
result.put(key, mutableCollection);
});
return result;
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public ImmutableListMultimap<K, V> toImmutable()
{
MutableMap<K, ImmutableList<V>> map = UnifiedMap.newMap();
this.map.forEachKeyValue((key, list) -> map.put(key, list.toImmutable()));
return new ImmutableListMultimapImpl<>(map);
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public ImmutableBagMultimap<K, V> toImmutable()
{
MutableMap<K, ImmutableBag<V>> map = UnifiedMap.newMap();
this.map.forEachKeyValue((key, bag) -> map.put(key, bag.toImmutable()));
return new ImmutableBagMultimapImpl<>(map);
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public ImmutableSetMultimap<K, V> toImmutable()
{
MutableMap<K, ImmutableSet<V>> map = UnifiedMap.newMap();
this.map.forEachKeyValue((key, set) -> map.put(key, set.toImmutable()));
return new ImmutableSetMultimapImpl<>(map);
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public MutableMap<K, RichIterable<V>> toMap()
{
MutableMap<K, RichIterable<V>> result = (MutableMap<K, RichIterable<V>>) (MutableMap<?, ?>) this.map.newEmpty();
this.map.forEachKeyValue((key, collection) -> {
MutableCollection<V> mutableCollection = collection.newEmpty();
mutableCollection.addAll(collection);
result.put(key, mutableCollection);
});
return result;
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public ImmutableSetMultimap<K, V> toImmutable()
{
MutableMap<K, ImmutableSet<V>> map = UnifiedMap.newMap();
this.map.forEachKeyValue((key, set) -> map.put(key, set.toImmutable()));
return new ImmutableSetMultimapImpl<>(map);
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public ImmutableListMultimap<K, V> toImmutable()
{
MutableMap<K, ImmutableList<V>> map = UnifiedMap.newMap();
this.map.forEachKeyValue((key, list) -> map.put(key, list.toImmutable()));
return new ImmutableListMultimapImpl<>(map);
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public ImmutableSortedBagMultimap<K, V> toImmutable()
{
MutableMap<K, ImmutableSortedBag<V>> map = UnifiedMap.newMap();
this.map.forEachKeyValue((key, bag) -> map.put(key, bag.toImmutable()));
return new ImmutableSortedBagMultimapImpl<>(map, this.comparator());
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public ImmutableSortedSetMultimap<K, V> toImmutable()
{
MutableMap<K, ImmutableSortedSet<V>> map = UnifiedMap.newMap();
this.map.forEachKeyValue((key, set) -> map.put(key, set.toImmutable()));
return new ImmutableSortedSetMultimapImpl<>(map, this.comparator());
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public ImmutableSortedBagMultimap<K, V> toImmutable()
{
MutableMap<K, ImmutableSortedBag<V>> map = UnifiedMap.newMap();
this.map.forEachKeyValue((key, bag) -> map.put(key, bag.toImmutable()));
return new ImmutableSortedBagMultimapImpl<>(map, this.comparator());
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public ImmutableSortedSetMultimap<K, V> toImmutable()
{
MutableMap<K, ImmutableSortedSet<V>> map = UnifiedMap.newMap();
this.map.forEachKeyValue((key, set) -> map.put(key, set.toImmutable()));
return new ImmutableSortedSetMultimapImpl<>(map, this.comparator());
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public ImmutableSortedBagMultimap<K, V> toImmutable()
{
MutableMap<K, ImmutableSortedBag<V>> map = UnifiedMap.newMap();
this.map.forEachKeyValue((key, bag) -> map.put(key, bag.toImmutable()));
return new ImmutableSortedBagMultimapImpl<>(map, this.comparator());
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public ImmutableBagMultimap<K, V> toImmutable()
{
MutableMap<K, ImmutableBag<V>> result = (MutableMap<K, ImmutableBag<V>>) (MutableMap<?, ?>) this.createMapWithKeyCount(this.map.size());
this.map.forEachKeyValue((key, bag) -> result.put(key, bag.toImmutable()));
return new ImmutableBagMultimapImpl<>(result);
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public ImmutableBagMultimap<K, V> toImmutable()
{
MutableMap<K, ImmutableBag<V>> result = (MutableMap<K, ImmutableBag<V>>) (MutableMap<?, ?>) this.createMapWithKeyCount(this.map.size());
this.map.forEachKeyValue((key, bag) -> result.put(key, bag.toImmutable()));
return new ImmutableBagMultimapImpl<>(result);
}
代码示例来源:origin: eclipse/eclipse-collections
@Override
public ImmutableSortedSetMultimap<K, V> toImmutable()
{
MutableMap<K, ImmutableSortedSet<V>> map = UnifiedMap.newMap();
this.map.forEachKeyValue((key, set) -> map.put(key, set.toImmutable()));
return new ImmutableSortedSetMultimapImpl<>(map, this.comparator());
}
内容来源于网络,如有侵权,请联系作者删除!