Package 

Class StagingArea


  • 
    public class StagingArea
    
                        

    This is class encapsulates Map that maps ImageCacheKeys to EncodedImages pointing to PooledByteBuffers. It is used by SimpleImageCache to store values that are being written to disk cache, so that they can be returned by parallel cache get operations.

    • Method Summary

      Modifier and Type Method Description
      static StagingArea getInstance()
      synchronized void put(CacheKey key, EncodedImage encodedImage) Stores key-value in this StagingArea.
      void clearAll() Removes all items from the StagingArea.
      boolean remove(CacheKey key) Removes item from the StagingArea.
      synchronized boolean remove(CacheKey key, EncodedImage encodedImage) Removes key-value from the StagingArea.
      synchronized EncodedImage get(CacheKey key)
      synchronized boolean containsKey(CacheKey key) Determine if an valid entry for the key exists in the staging area.
      • Methods inherited from class java.lang.Object

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

      • put

         synchronized void put(CacheKey key, EncodedImage encodedImage)

        Stores key-value in this StagingArea. This call overrides previous value of stored reference if

        Parameters:
        encodedImage - EncodedImage to be associated with key
      • clearAll

         void clearAll()

        Removes all items from the StagingArea.

      • remove

         boolean remove(CacheKey key)

        Removes item from the StagingArea.

      • remove

         synchronized boolean remove(CacheKey key, EncodedImage encodedImage)

        Removes key-value from the StagingArea. Both key and value must match.

        Parameters:
        encodedImage - value corresponding to key
      • get

        @Nullable() synchronized EncodedImage get(CacheKey key)
      • containsKey

         synchronized boolean containsKey(CacheKey key)

        Determine if an valid entry for the key exists in the staging area.