K
- key typeV
- value typepublic class ConcurrentHashMap<K,V> extends AbstractMap<K,V> implements ConcurrentMap<K,V>
ConcurrentHashMap
.
Note that the javascript is single-threaded, it is essentially a HashMap
,
implementing the new methods introduced by ConcurrentMap
.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
ConcurrentHashMap() |
ConcurrentHashMap(int initialCapacity) |
ConcurrentHashMap(int initialCapacity,
float loadFactor) |
ConcurrentHashMap(Map<? extends K,? extends V> t) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Object value) |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Enumeration<V> |
elements() |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
Enumeration<K> |
keys() |
V |
put(K key,
V value) |
V |
putIfAbsent(K key,
V value) |
V |
remove(Object key) |
boolean |
remove(Object key,
Object value) |
V |
replace(K key,
V value) |
boolean |
replace(K key,
V oldValue,
V newValue) |
clear, equals, hashCode, isEmpty, keySet, putAll, size, toString, values
clear, compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, isEmpty, keySet, merge, putAll, replaceAll, size, values
public ConcurrentHashMap()
public ConcurrentHashMap(int initialCapacity)
public ConcurrentHashMap(int initialCapacity, float loadFactor)
public V putIfAbsent(K key, V value)
putIfAbsent
in interface ConcurrentMap<K,V>
putIfAbsent
in interface Map<K,V>
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
containsKey
in class AbstractMap<K,V>
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
containsValue
in class AbstractMap<K,V>
public boolean contains(Object value)
public Enumeration<V> elements()
public Enumeration<K> keys()
Copyright © 2018. All rights reserved.