Class SoftCache<K,​V>

  • Type Parameters:
    K - the type of keys maintained by this map
    V - the type of mapped values

    public class SoftCache<K,​V>
    extends Object
    A concurrent version of WeakHashMap in which the values are soft references.
    Since:
    10.8RC1, 9.11.8
    Version:
    $Id: a81a91e45923397c7b064d225402cc1819f2b3f7 $
    • Constructor Detail

      • SoftCache

        public SoftCache()
    • Method Detail

      • get

        public V get​(K key)
        Parameters:
        key - the entry key
        Returns:
        the value associated to the passed key
      • get

        public V get​(K key,
                     V defaultValue)
        Get the value associated to the passed key. If no value can be found store and return the passed default value.
        Parameters:
        key - the entry key
        defaultValue - the default value
        Returns:
        the value associated to the passed key
      • put

        public void put​(K key,
                        V value)
        Associate passed key to passed value.
        Parameters:
        key - the entry key
        value - the entry value