Package kieker.common.util.map
Class BoundedConcurrentHashMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.concurrent.ConcurrentHashMap<K,V>
kieker.common.util.map.BoundedConcurrentHashMap<K,V>
- Type Parameters:
K- The type of the keys.V- The type of the values.
- All Implemented Interfaces:
Serializable,ConcurrentMap<K,,V> Map<K,V>
- Since:
- 1.10
- Author:
- Nils Christian Ehmke
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class java.util.concurrent.ConcurrentHashMap
ConcurrentHashMap.KeySetView<K extends Object,V extends Object> Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
ConstructorsConstructorDescriptionBoundedConcurrentHashMap(BoundedConcurrentHashMap.BoundedCacheBehaviour boundedCacheBehaviour, int maxCacheSize) Initialize a bounded concurrent hash map. -
Method Summary
Modifier and TypeMethodDescriptionWorks like the overriden method, except thatnullis returned, if the given element could not be added due to map limitations.putIfAbsent(K key, V value) Works like the overriden method, except thatnullis returned, if the given element could not be added due to map limitations.Methods inherited from class java.util.concurrent.ConcurrentHashMap
clear, 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, putAll, reduce, reduceEntries, reduceEntries, reduceEntriesToDouble, reduceEntriesToInt, reduceEntriesToLong, reduceKeys, reduceKeys, reduceKeysToDouble, reduceKeysToInt, reduceKeysToLong, reduceToDouble, reduceToInt, reduceToLong, reduceValues, reduceValues, reduceValuesToDouble, reduceValuesToInt, reduceValuesToLong, remove, remove, replace, replace, replaceAll, search, searchEntries, searchKeys, searchValues, size, toString, valuesMethods inherited from class java.util.AbstractMap
clone
-
Constructor Details
-
BoundedConcurrentHashMap
public BoundedConcurrentHashMap(BoundedConcurrentHashMap.BoundedCacheBehaviour boundedCacheBehaviour, int maxCacheSize) Initialize a bounded concurrent hash map.- Parameters:
boundedCacheBehaviour- set the cache behaviormaxCacheSize- define limit of the cache
-
-
Method Details
-
put
Works like the overriden method, except thatnullis returned, if the given element could not be added due to map limitations. -
putIfAbsent
Works like the overriden method, except thatnullis returned, if the given element could not be added due to map limitations.- Specified by:
putIfAbsentin interfaceConcurrentMap<K,V> - Specified by:
putIfAbsentin interfaceMap<K,V> - Overrides:
putIfAbsentin classConcurrentHashMap<K,V> - Parameters:
key- key-valuevalue- the associated value- Returns:
- the previous value or null
-