public class

StagingArea

extends Object
java.lang.Object
   ↳ com.facebook.imagepipeline.cache.StagingArea

Class Overview

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.

Summary

Public Methods
void clearAll()
Removes all items from the StagingArea.
synchronized boolean containsKey(CacheKey key)
Determine if an valid entry for the key exists in the staging area.
synchronized EncodedImage get(CacheKey key)
static StagingArea getInstance()
synchronized void put(CacheKey key, EncodedImage encodedImage)
Stores key-value in this StagingArea.
synchronized boolean remove(CacheKey key, EncodedImage encodedImage)
Removes key-value from the StagingArea.
boolean remove(CacheKey key)
Removes item from the StagingArea.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public void clearAll ()

Removes all items from the StagingArea.

public synchronized boolean containsKey (CacheKey key)

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

public synchronized EncodedImage get (CacheKey key)

Returns
  • value associated with given key or null if no value is associated

public static StagingArea getInstance ()

public 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

public 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
Returns
  • true if item was removed

public boolean remove (CacheKey key)

Removes item from the StagingArea.

Returns
  • true if item was removed