Class WeakIdentityConcurrentMap<K,V>

java.lang.Object
org.ehcache.sizeof.util.WeakIdentityConcurrentMap<K,V>
Type Parameters:
K - The key type
V - The value type

public final class WeakIdentityConcurrentMap<K,V> extends Object
A poor man's implementation of a WeakIdentityConcurrentMap to hold the CacheManager associated ExecutorServices
  • Field Details

  • Constructor Details

    • WeakIdentityConcurrentMap

      public WeakIdentityConcurrentMap()
      Constructor
    • WeakIdentityConcurrentMap

      public WeakIdentityConcurrentMap(WeakIdentityConcurrentMap.CleanUpTask<V> cleanUpTask)
      Constructor
      Parameters:
      cleanUpTask - task cleaning up references
  • Method Details

    • put

      public V put(K key, V value)
      Puts into the underlying
      Parameters:
      key - key with which the specified value is to be associated
      value - value to be associated with the specified key
      Returns:
      the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key, if the implementation supports null values.)
    • remove

      public V remove(K key)
      Remove from the underlying
      Parameters:
      key - key whose mapping is to be removed from the map
      Returns:
      the previous value associated with key, or null if there was no mapping for key.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • putIfAbsent

      public V putIfAbsent(K key, V value)
      Puts into the underlying
      Parameters:
      key - key with which the specified value is to be associated
      value - value to be associated with the specified key
      Returns:
      the previous value associated with the specified key, or null if there was no mapping for the key. (A null return can also indicate that the map previously associated null with the key, if the implementation supports null values.)
    • get

      public V get(K key)
      Parameters:
      key - the key whose associated value is to be returned
      Returns:
      the value to which the specified key is mapped, or null if this map contains no mapping for the key
    • cleanUp

      public void cleanUp()
    • keySet

      public Set<K> keySet()
      Returns:
      a set view of the keys contained in this map
    • containsKey

      public boolean containsKey(K key)