Example usage for Java java.util.concurrent ConcurrentHashMap fields, constructors, methods, implement or subclass
The text is from its open source code.
ConcurrentHashMap() Creates a new, empty map with the default initial table size (16). | |
ConcurrentHashMap(int initialCapacity) Creates a new, empty map with an initial table size accommodating the specified number of elements without the need to dynamically resize. | |
ConcurrentHashMap(Map extends K, ? extends V> m) Creates a new map with the same mappings as the given map. | |
ConcurrentHashMap(int initialCapacity, float loadFactor, int concurrencyLevel) Creates a new, empty map with an initial table size based on the given number of elements ( initialCapacity ), initial table density ( loadFactor ), and number of concurrently updating threads ( concurrencyLevel ). | |
ConcurrentHashMap(int initialCapacity, float loadFactor) Creates a new, empty map with an initial table size based on the given number of elements ( initialCapacity ) and initial table density ( loadFactor ). |
void | clear() Removes all of the mappings from this map. |
V | compute(K key, BiFunction super K, ? super V, ? extends V> remappingFunction) Attempts to compute a mapping for the specified key and its current mapped value (or null if there is no current mapping). |
boolean | contains(Object value) Tests if some key maps into the specified value in this table. |
boolean | containsKey(Object key) Tests if the specified object is a key in this table. |
void | forEach(BiConsumer super K, ? super V> action) |
void | forEachValue(long parallelismThreshold, Consumer super V> action) Performs the given action for each value. |
V | get(Object key) Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key. |
boolean | isEmpty() |
Enumeration | keys() Returns an enumeration of the keys in this table. |
KeySetView | newKeySet() Creates a new Set backed by a ConcurrentHashMap from the given type to Boolean.TRUE . |
KeySetView | newKeySet(int initialCapacity) Creates a new Set backed by a ConcurrentHashMap from the given type to Boolean.TRUE . |
V | put(K key, V value) Maps the specified key to the specified value in this table. |
void | putAll(Map extends K, ? extends V> m) Copies all of the mappings from the specified map to this one. |
V | putIfAbsent(K key, V value) |
Map.Entry | reduceEntries(long parallelismThreshold, BiFunction Returns the result of accumulating all entries using the given reducer to combine values, or null if none. |
V | remove(Object key) Removes the key (and its corresponding value) from this map. |
boolean | remove(Object key, Object value) |
boolean | replace(K key, V oldValue, V newValue) |
V | replace(K key, V value) |
U | search(long parallelismThreshold, BiFunction super K, ? super V, ? extends U> searchFunction) Returns a non-null result from applying the given search function on each (key, value), or null if none. |
int | size() |
String | toString() Returns a string representation of this map. |