Top Description Methods
org.eclipse.collections.api.map

public Interface ConcurrentMutableMap<K, V>

extends MutableMap<K, V>, ConcurrentMap<K, V>
Imports
java.util.Map, java.util.concurrent.ConcurrentMap, java.util.function.BiConsumer, .BiFunction, org.eclipse.collections.api.block.procedure.Procedure

A ConcurrentMutableMap provides an api which combines and supports both MutableMap and ConcurrentMap.

Method Summary

Modifier and TypeMethod and Description
public default void
forEach(BiConsumer<? super K, ? super V> action)

Overrides default org.eclipse.collections.api.map.MutableMapIterable.forEach, org.eclipse.collections.api.map.MapIterable.forEach, java.util.concurrent.ConcurrentMap.forEach.

Performs the given action for each entry in this map until all entries have been processed or the action throws an exception.

public default V
getOrDefault(Object key, V defaultValue)

Overrides default org.eclipse.collections.api.map.MutableMapIterable.getOrDefault, org.eclipse.collections.api.map.MapIterable.getOrDefault, java.util.concurrent.ConcurrentMap.getOrDefault.

Returns the value to which the specified key is mapped, or defaultValue if this map contains no mapping for the key.

public V
merge(K key, V value, BiFunction<? super V, ? super V, ? extends V> remappingFunction)

Redeclares as abstract: java.util.Map.merge, java.util.concurrent.ConcurrentMap.merge.

A concurrent implementation of ConcurrentMap#merge(Object, Object, BiFunction) and Map#merge(Object, Object, BiFunction).

public ConcurrentMutableMap<K, V>
tap(Procedure<? super V> procedure)

Redeclares org.eclipse.collections.api.map.MutableMap.tap.

Executes the Procedure for each value of the map and returns this.

public default ConcurrentMutableMap<K, V>
withMap(Map<? extends K, ? extends V> map)

Overrides default org.eclipse.collections.api.map.MutableMap.withMap.

Similar to putAll(Map), but returns this instead of void

public default ConcurrentMutableMap<K, V>
withMapIterable(MapIterable<? extends K, ? extends V> mapIterable)

Overrides default org.eclipse.collections.api.map.MutableMap.withMapIterable.

Inherited from java.util.concurrent.ConcurrentMap:
computecomputeIfAbsentcomputeIfPresentputIfAbsentremovereplacereplacereplaceAll
Inherited from org.eclipse.collections.api.map.MutableMap:
aggregateByaggregateByaggregateInPlaceByasSynchronizedasUnmodifiableclonecollectcollectcollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIfcollectIntcollectKeysAndValuescollectKeysUniquecollectLongcollectShortcollectValuescollectWithflatCollectflatCollectWithflipflipUniqueValuesgroupBygroupByEachgroupByUniqueKeynewEmptypartitionpartitionWithreduceByrejectrejectrejectWithselectselectselectInstancesOfselectWithwithAllKeyValueArgumentswithAllKeyValueswithKeyValuewithoutAllKeyswithoutKeyzipzipWithIndex

Method Detail

forEachback to summary
public default void forEach(BiConsumer<? super K, ? super V> action)

Overrides default org.eclipse.collections.api.map.MutableMapIterable.forEach, org.eclipse.collections.api.map.MapIterable.forEach, java.util.concurrent.ConcurrentMap.forEach.

Doc from java.util.concurrent.ConcurrentMap.forEach.

Performs the given action for each entry in this map until all entries have been processed or the action throws an exception. Unless otherwise specified by the implementing class, actions are performed in the order of entry set iteration (if an iteration order is specified.) Exceptions thrown by the action are relayed to the caller.

Annotations
@Override
getOrDefaultback to summary
public default V getOrDefault(Object key, V defaultValue)

Overrides default org.eclipse.collections.api.map.MutableMapIterable.getOrDefault, org.eclipse.collections.api.map.MapIterable.getOrDefault, java.util.concurrent.ConcurrentMap.getOrDefault.

Doc from java.util.concurrent.ConcurrentMap.getOrDefault.

Returns the value to which the specified key is mapped, or defaultValue if this map contains no mapping for the key.

Annotations
@Override
mergeback to summary
public V merge(K key, V value, BiFunction<? super V, ? super V, ? extends V> remappingFunction)

Redeclares as abstract: java.util.Map.merge, java.util.concurrent.ConcurrentMap.merge.

A concurrent implementation of ConcurrentMap#merge(Object, Object, BiFunction) and Map#merge(Object, Object, BiFunction). In the implementing classes, it is possible for the remappingFunction to be called multiple times. It is also possible for the remappingFunction to be called one or more times, but the result is not used (because the old entry was concurrently removed).

Annotations
@Override
tapback to summary
public ConcurrentMutableMap<K, V> tap(Procedure<? super V> procedure)

Redeclares org.eclipse.collections.api.map.MutableMap.tap.

Doc from org.eclipse.collections.api.map.MapIterable.tap.

Executes the Procedure for each value of the map and returns this.

return peopleByCity.tap(person -> LOGGER.info(person.getName()));
Annotations
@Override
withMapback to summary
public default ConcurrentMutableMap<K, V> withMap(Map<? extends K, ? extends V> map)

Overrides default org.eclipse.collections.api.map.MutableMap.withMap.

Doc from org.eclipse.collections.api.map.MutableMapIterable.withMap.

Similar to putAll(Map), but returns this instead of void

Annotations
@Override
withMapIterableback to summary
public default ConcurrentMutableMap<K, V> withMapIterable(MapIterable<? extends K, ? extends V> mapIterable)

Overrides default org.eclipse.collections.api.map.MutableMap.withMapIterable.

Annotations
@Override