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:
java.io.Serializable, java.util.concurrent.ConcurrentMap<K,​V>, java.util.Map<K,​V>

public class BoundedConcurrentHashMap<K,​V>
extends java.util.concurrent.ConcurrentHashMap<K,​V>
Since:
1.10
Author:
Nils Christian Ehmke
See Also:
Serialized Form
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  BoundedConcurrentHashMap.BoundedCacheBehaviour  

    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>

    Nested classes/interfaces inherited from class java.util.AbstractMap

    java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>

    Nested classes/interfaces inherited from interface java.util.Map

    java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
  • Constructor Summary

    Constructors 
    Constructor Description
    BoundedConcurrentHashMap​(BoundedConcurrentHashMap.BoundedCacheBehaviour boundedCacheBehaviour, int maxCacheSize)
    Initialize a bounded concurrent hash map.
  • Method Summary

    Modifier and Type Method Description
    V put​(K key, V value)
    Works like the overriden method, except that null is returned, if the given element could not be added due to map limitations.
    V putIfAbsent​(K key, V value)
    Works like the overriden method, except that null is 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, values

    Methods inherited from class java.util.AbstractMap

    clone

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • put

      public V put​(K key, V value)
      Works like the overriden method, except that null is returned, if the given element could not be added due to map limitations.
      Specified by:
      put in interface java.util.Map<K,​V>
      Overrides:
      put in class java.util.concurrent.ConcurrentHashMap<K,​V>
      Parameters:
      key - key-value
      value - the associated value
      Returns:
      the previous value associated with key, or null if there was no mapping for key, or null if the bounds limit was reached
    • putIfAbsent

      public V putIfAbsent​(K key, V value)
      Works like the overriden method, except that null is returned, if the given element could not be added due to map limitations.
      Specified by:
      putIfAbsent in interface java.util.concurrent.ConcurrentMap<K,​V>
      Specified by:
      putIfAbsent in interface java.util.Map<K,​V>
      Overrides:
      putIfAbsent in class java.util.concurrent.ConcurrentHashMap<K,​V>
      Parameters:
      key - key-value
      value - the associated value
      Returns:
      the previous value or null