Class Cache.Soft

java.lang.Object
java.lang.ref.Reference<V>
java.lang.ref.SoftReference<V>
org.apache.sis.util.collection.Cache.Soft
All Implemented Interfaces:
Disposable
Enclosing class:
Cache<K,V>

private final class Cache.Soft extends SoftReference<V> implements Disposable
A soft reference which removes itself from the cache when the reference is garbage-collected.
  • Field Details

    • key

      private final K key
      The key of the referenced value.
  • Constructor Details

    • Soft

      Soft(K key, V value)
      Creates a references to be stored in the cache under the given key.
  • Method Details

    • dispose

      public void dispose()
      Removes the reference from the map.
      Specified by:
      dispose in interface Disposable