Package co.elastic.apm.agent.util
Class KeyListConcurrentHashMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.concurrent.ConcurrentHashMap<K,V>
-
- co.elastic.apm.agent.util.KeyListConcurrentHashMap<K,V>
-
- All Implemented Interfaces:
java.io.Serializable,java.util.concurrent.ConcurrentMap<K,V>,java.util.Map<K,V>
public class KeyListConcurrentHashMap<K,V> extends java.util.concurrent.ConcurrentHashMap<K,V>A subclass ofConcurrentHashMapwhich maintains aListof all the keys in the map. It can be used to iterate over the map's keys without allocating anIterator- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.concurrent.ConcurrentHashMap
java.util.concurrent.ConcurrentHashMap.KeySetView<K extends java.lang.Object,V extends java.lang.Object>
-
-
Constructor Summary
Constructors Constructor Description KeyListConcurrentHashMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()java.util.List<K>keyList()Returns a mutableList, roughly equal to theConcurrentHashMap.keySet().Vput(K key, V value)voidputAll(java.util.Map<? extends K,? extends V> m)VputIfAbsent(K key, V value)Vremove(java.lang.Object key)booleanremove(java.lang.Object key, java.lang.Object value)-
Methods inherited from class java.util.concurrent.ConcurrentHashMap
compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, forEach, forEach, forEachEntry, forEachEntry, forEachKey, forEachKey, forEachValue, forEachValue, get, getOrDefault, hashCode, isEmpty, keys, keySet, keySet, mappingCount, merge, newKeySet, newKeySet, reduce, reduceEntries, reduceEntries, reduceEntriesToDouble, reduceEntriesToInt, reduceEntriesToLong, reduceKeys, reduceKeys, reduceKeysToDouble, reduceKeysToInt, reduceKeysToLong, reduceToDouble, reduceToInt, reduceToLong, reduceValues, reduceValues, reduceValuesToDouble, reduceValuesToInt, reduceValuesToLong, replace, replace, replaceAll, search, searchEntries, searchKeys, searchValues, size, toString, values
-
-
-
-
Method Detail
-
remove
public V remove(java.lang.Object key)
-
clear
public void clear()
-
remove
public boolean remove(java.lang.Object key, java.lang.Object value)
-
keyList
public java.util.List<K> keyList()
Returns a mutableList, roughly equal to theConcurrentHashMap.keySet().Note that in concurrent scenarios, the key list may be a subset of the values of the respective
ConcurrentHashMap.keySet(). Entries added via thecompute*family of methods are not reflected in the list.Do not modify this list.
- Returns:
- a
List, roughly equal to theConcurrentHashMap.keySet()
-
-