Class SoftReferenceCache

java.lang.Object
org.apache.pdfbox.jbig2.util.cache.SoftReferenceCache
All Implemented Interfaces:
Cache

public class SoftReferenceCache extends Object implements Cache
  • Field Details

  • Constructor Details

    • SoftReferenceCache

      public SoftReferenceCache()
  • Method Details

    • put

      public Object put(Object key, Object value, int sizeEstimate)
      Specified by:
      put in interface Cache
      Parameters:
      key - value to be used as key
      value - value to be stored
      sizeEstimate - estimated size
      Returns:
      the old object, that was replaced if present. Otherwise null.
    • get

      public Object get(Object key)
      Specified by:
      get in interface Cache
    • clear

      public void clear()
      Description copied from interface: Cache
      Removes all mappings from a map (optional operation).
      Specified by:
      clear in interface Cache
    • remove

      public Object remove(Object key)
      Specified by:
      remove in interface Cache
      Parameters:
      key - the key of the to be removed object
      Returns:
      the removed object, if present. Otherwise null.
    • getValueNullSafe

      private Object getValueNullSafe(SoftReference<?> softReference)