Top Description Fields Constructors Methods
org.eclipse.collections.impl.map.mutable

public final Class ConcurrentMutableHashMap<K, V>

extends AbstractMutableMap<K, V>
implements ConcurrentMutableMap<K, V>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.eclipse.collections.api.map.ConcurrentMutableMap, java.util.concurrent.ConcurrentMap, java.util.Map, org.eclipse.collections.api.map.MutableMap, java.lang.Cloneable, org.eclipse.collections.api.map.UnsortedMapIterable, org.eclipse.collections.api.map.MapIterable, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.InternalIterable, java.lang.Iterable, org.eclipse.collections.api.map.MutableMapIterable
Annotations
@Deprecated
Imports
java.io.Serializable, java.util.Collection, .Iterator, .Map, .Set, java.util.concurrent.ConcurrentHashMap, .ConcurrentMap, java.util.function.BiFunction, org.eclipse.collections.api.block.function.Function, .Function0, .Function2, org.eclipse.collections.api.block.procedure.Procedure, .Procedure2, org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure, org.eclipse.collections.api.factory.Maps, org.eclipse.collections.api.map.ConcurrentMutableMap, .ImmutableMap, .MutableMap, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.block.procedure.MapEntryToProcedure2, org.eclipse.collections.impl.utility.Iterate, org.eclipse.collections.impl.utility.internal.IterableIterate

Deprecated

since 2.0

A simple concurrent implementation of MutableMap which uses java.util.concurrent.ConcurrentHashMap for its underlying concurrent Map implementation.
See Also
org.eclipse.collections.impl.map.mutable.ConcurrentHashMap

Field Summary

Modifier and TypeField and Description
private final ConcurrentMap<K, V>
private static final long

Constructor Summary

AccessConstructor and Description
private
public

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Implements java.util.Map.clear.

Removes all of the mappings from this map (optional operation).

public MutableMap<K, V>
clone()

Implements abstract org.eclipse.collections.impl.map.mutable.AbstractMutableMap.clone.

Implements org.eclipse.collections.api.map.MutableMap.clone.

Creates and returns a copy of this object.

public <E> MutableMap<K, V>
collectKeysAndValues(Iterable<E> iterable, Function<? super E, ? extends K> keyFunction, Function<? super E, ? extends V> valueFunction)

Implements org.eclipse.collections.api.map.MutableMap.collectKeysAndValues.

Adds all the entries derived from iterable to this.

public boolean
containsKey(Object key)

Implements org.eclipse.collections.api.map.MapIterable.containsKey, java.util.Map.containsKey.

Returns true if this map contains a mapping for the specified key.

public boolean
containsValue(Object value)

Implements org.eclipse.collections.api.map.MapIterable.containsValue, java.util.Map.containsValue.

Returns true if this map maps one or more keys to the specified value.

public Set<Map.Entry<K, V>>
entrySet()

Implements java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map.

public boolean
public void
forEachKey(Procedure<? super K> procedure)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.forEachKey.

Implements org.eclipse.collections.api.map.MapIterable.forEachKey.

Calls the procedure with each key of the map.

public void
forEachKeyValue(Procedure2<? super K, ? super V> procedure)

Implements org.eclipse.collections.api.map.MapIterable.forEachKeyValue.

Calls the procedure with each key-value pair of the map.

public void
forEachValue(Procedure<? super V> procedure)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.forEachValue.

Implements org.eclipse.collections.api.map.MapIterable.forEachValue.

Calls the procedure with each value of the map.

public <P> void
forEachWith(Procedure2<? super V, ? super P> procedure, P parameter)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.forEachWith.

Implements org.eclipse.collections.api.InternalIterable.forEachWith.

The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument.

public void
forEachWithIndex(ObjectIntProcedure<? super V> objectIntProcedure)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.forEachWithIndex.

Implements org.eclipse.collections.api.InternalIterable.forEachWithIndex.

Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure.

public V
get(Object key)

Implements org.eclipse.collections.api.map.MapIterable.get, java.util.Map.get.

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

public V
getIfAbsent(K key, Function0<? extends V> function)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.getIfAbsent.

Implements org.eclipse.collections.api.map.MapIterable.getIfAbsent.

Return the value in the Map that corresponds to the specified key, or if there is no value at the key, return the result of evaluating the specified Function0.

public V
public V
public V
getIfAbsentPut(K key, Function<? super K, ? extends V> factory)

Overrides org.eclipse.collections.impl.map.mutable.AbstractMutableMapIterable.getIfAbsentPut.

Implements org.eclipse.collections.api.map.MutableMapIterable.getIfAbsentPut.

Get and return the value in the Map at the specified key.

public <P> V
getIfAbsentPutWith(K key, Function<? super P, ? extends V> function, P parameter)

Overrides org.eclipse.collections.impl.map.mutable.AbstractMutableMapIterable.getIfAbsentPutWith.

Implements org.eclipse.collections.api.map.MutableMapIterable.getIfAbsentPutWith.

Get and return the value in the Map at the specified key.

public V
getIfAbsentValue(K key, V value)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.getIfAbsentValue.

Implements org.eclipse.collections.api.map.MapIterable.getIfAbsentValue.

Return the value in the Map that corresponds to the specified key, or if there is no value at the key, return value.

public <P> V
getIfAbsentWith(K key, Function<? super P, ? extends V> function, P parameter)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.getIfAbsentWith.

Implements org.eclipse.collections.api.map.MapIterable.getIfAbsentWith.

Return the value in the Map that corresponds to the specified key, or if there is no value at the key, return the result of evaluating the specified function and parameter.

public int
public <A> A
ifPresentApply(K key, Function<? super V, ? extends A> function)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.ifPresentApply.

Implements org.eclipse.collections.api.map.MapIterable.ifPresentApply.

If there is a value in the Map that corresponds to the specified key return the result of applying the specified Function on the value, otherwise return null.

public boolean
public Iterator<V>
public Set<K>
keySet()

Implements java.util.Map.keySet.

Returns a Set view of the keys contained in this map.

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

Overrides default java.util.Map.merge.

Implements org.eclipse.collections.api.map.ConcurrentMutableMap.merge.

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

public <K, V> MutableMap<K, V>
newEmpty(int capacity)

Implements abstract org.eclipse.collections.impl.map.mutable.AbstractMutableMap.newEmpty.

Creates a new instance of the same type, using the given capacity and the default growth parameters.

public MutableMap<K, V>
newEmpty()

Implements org.eclipse.collections.api.map.MutableMap.newEmpty, org.eclipse.collections.api.map.MutableMapIterable.newEmpty.

Creates a new instance of the same type, using the default capacity and growth parameters.

public static <NK, NV> ConcurrentMutableHashMap<NK, NV>
newMap()
References Deprecated ConcurrentMutableHashMap is deprecated or references (maybe indirectly) at least one deprecated element.

public static <NK, NV> ConcurrentMutableHashMap<NK, NV>
newMap(int initialCapacity)
References Deprecated ConcurrentMutableHashMap is deprecated or references (maybe indirectly) at least one deprecated element.

public static <NK, NV> ConcurrentMutableHashMap<NK, NV>
newMap(int initialCapacity, float loadFactor, int concurrencyLevel)
References Deprecated ConcurrentMutableHashMap is deprecated or references (maybe indirectly) at least one deprecated element.

public static <NK, NV> ConcurrentMutableHashMap<NK, NV>
newMap(Map<NK, NV> map)
References Deprecated ConcurrentMutableHashMap is deprecated or references (maybe indirectly) at least one deprecated element.

public boolean
notEmpty()

Overrides default org.eclipse.collections.api.RichIterable.notEmpty.

The English equivalent of !this.isEmpty()

public V
put(K key, V value)

Implements java.util.Map.put.

Associates the specified value with the specified key in this map (optional operation).

public void
putAll(Map<? extends K, ? extends V> map)

Implements java.util.Map.putAll.

Copies all of the mappings from the specified map to this map (optional operation).

public V
putIfAbsent(K key, V value)

Overrides default java.util.Map.putIfAbsent.

Implements java.util.concurrent.ConcurrentMap.putIfAbsent.

If the specified key is not already associated with a value, associates it with the given value.

public V
remove(Object key)

Implements java.util.Map.remove.

Removes the mapping for a key from this map if it is present (optional operation).

public boolean
remove(Object key, Object value)

Overrides default java.util.Map.remove.

Implements java.util.concurrent.ConcurrentMap.remove.

Removes the entry for a key only if currently mapped to a given value.

public V
removeKey(K key)

Implements org.eclipse.collections.api.map.MutableMapIterable.removeKey.

Remove an entry from the map at the specified key.

public boolean
replace(K key, V oldValue, V newValue)

Overrides default java.util.Map.replace.

Implements java.util.concurrent.ConcurrentMap.replace.

Replaces the entry for a key only if currently mapped to a given value.

public V
replace(K key, V value)

Overrides default java.util.Map.replace.

Implements java.util.concurrent.ConcurrentMap.replace.

Replaces the entry for a key only if currently mapped to some value.

public int
size()

Implements org.eclipse.collections.api.RichIterable.size, java.util.Map.size.

Returns the number of key-value mappings in this map.

public ConcurrentMutableMap<K, V>
public ImmutableMap<K, V>
public String
toString()

Overrides org.eclipse.collections.impl.AbstractRichIterable.toString.

Implements org.eclipse.collections.api.map.MapIterable.toString, org.eclipse.collections.api.RichIterable.toString.

Returns a string with the keys and values of this map separated by commas with spaces and enclosed in curly braces.

public V
updateValue(K key, Function0<? extends V> factory, Function<? super V, ? extends V> function)

Overrides org.eclipse.collections.impl.map.mutable.AbstractMutableMapIterable.updateValue.

Implements org.eclipse.collections.api.map.MutableMapIterable.updateValue.

Looks up the value associated with key, applies the function to it, and replaces the value.

public <P> V
updateValueWith(K key, Function0<? extends V> factory, Function2<? super V, ? super P, ? extends V> function, P parameter)

Overrides org.eclipse.collections.impl.map.mutable.AbstractMutableMapIterable.updateValueWith.

Implements org.eclipse.collections.api.map.MutableMapIterable.updateValueWith.

Same as updateValue(Object, Function0, Function) with a Function2 and specified parameter which is passed to the function.

public Collection<V>
values()

Implements java.util.Map.values.

Returns a Collection view of the values contained in this map.

public ConcurrentMutableHashMap<K, V>
withAllKeyValueArguments(Pair<? extends K, ? extends V>... keyValues)

Overrides org.eclipse.collections.impl.map.mutable.AbstractMutableMap.withAllKeyValueArguments.

Implements org.eclipse.collections.api.map.MutableMap.withAllKeyValueArguments, org.eclipse.collections.api.map.MutableMapIterable.withAllKeyValueArguments.

References Deprecated ConcurrentMutableHashMap is deprecated or references (maybe indirectly) at least one deprecated element.

Convenience var-args version of withAllKeyValues

public ConcurrentMutableHashMap<K, V>
withAllKeyValues(Iterable<? extends Pair<? extends K, ? extends V>> keyValues)

Overrides org.eclipse.collections.impl.map.mutable.AbstractMutableMap.withAllKeyValues.

Implements org.eclipse.collections.api.map.MutableMap.withAllKeyValues, org.eclipse.collections.api.map.MutableMapIterable.withAllKeyValues.

References Deprecated ConcurrentMutableHashMap is deprecated or references (maybe indirectly) at least one deprecated element.

This method allows mutable, fixed size, and immutable maps the ability to add elements to their existing elements.

public ConcurrentMutableHashMap<K, V>
withKeyValue(K key, V value)

Overrides org.eclipse.collections.impl.map.mutable.AbstractMutableMap.withKeyValue.

Implements org.eclipse.collections.api.map.MutableMap.withKeyValue, org.eclipse.collections.api.map.MutableMapIterable.withKeyValue.

References Deprecated ConcurrentMutableHashMap is deprecated or references (maybe indirectly) at least one deprecated element.

This method allows mutable, fixed size, and immutable maps the ability to add elements to their existing elements.

public ConcurrentMutableHashMap<K, V>
withoutAllKeys(Iterable<? extends K> keys)

Overrides org.eclipse.collections.impl.map.mutable.AbstractMutableMap.withoutAllKeys.

Implements org.eclipse.collections.api.map.MutableMap.withoutAllKeys, org.eclipse.collections.api.map.MutableMapIterable.withoutAllKeys.

References Deprecated ConcurrentMutableHashMap is deprecated or references (maybe indirectly) at least one deprecated element.

This method allows mutable, fixed size, and immutable maps the ability to remove elements from their existing elements.

public ConcurrentMutableHashMap<K, V>
withoutKey(K key)

Overrides org.eclipse.collections.impl.map.mutable.AbstractMutableMap.withoutKey.

Implements org.eclipse.collections.api.map.MutableMap.withoutKey, org.eclipse.collections.api.map.MutableMapIterable.withoutKey.

References Deprecated ConcurrentMutableHashMap is deprecated or references (maybe indirectly) at least one deprecated element.

This method allows mutable, fixed size, and immutable maps the ability to remove elements from their existing elements.

Inherited from org.eclipse.collections.impl.map.mutable.AbstractMutableMap:
asSynchronizedasUnmodifiablecollectcollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIfcollectIntcollectKeysUniquecollectLongcollectShortcollectValuescollectWithflatCollectflipgroupBygroupByEachgroupByUniqueKeypartitionpartitionWithrejectrejectrejectWithreplaceAllselectselectselectInstancesOfselectWithzipzipWithIndex