Class SoftCache<K,​V,​D>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.concurrent.ConcurrentHashMap<K,​java.lang.Object> map  
    • Constructor Summary

      Constructors 
      Constructor Description
      SoftCache()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      V getInstance​(K key, D data)
      Retrieves an instance from the cache.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • map

        private java.util.concurrent.ConcurrentHashMap<K,​java.lang.Object> map
    • Constructor Detail

      • SoftCache

        public SoftCache()
    • Method Detail

      • getInstance

        public final V getInstance​(K key,
                                   D data)
        Description copied from class: CacheBase
        Retrieves an instance from the cache. Calls createInstance(key, data) if the cache does not already contain an instance with this key. Ignores data if the cache already contains an instance with this key.
        Specified by:
        getInstance in class CacheBase<K,​V,​D>
        Parameters:
        key - Cache lookup key for the requested instance
        data - Data for createInstance() if the instance is not already cached
        Returns:
        The requested instance