public class

SmallCacheIfRequestedDiskCachePolicy

extends Object
implements DiskCachePolicy
java.lang.Object
   ↳ com.facebook.imagepipeline.cache.SmallCacheIfRequestedDiskCachePolicy

Class Overview

Task factory for the simple disk cache case of attempting to load the image from whichever cache is requested by the image request.

Summary

Public Constructors
SmallCacheIfRequestedDiskCachePolicy(BufferedDiskCache defaultBufferedDiskCache, BufferedDiskCache smallImageBufferedDiskCache, CacheKeyFactory cacheKeyFactory)
Public Methods
Task<EncodedImage> createAndStartCacheReadTask(ImageRequest imageRequest, Object callerContext, AtomicBoolean isCancelled)
Creates and starts the task to carry out a disk cache read, using whichever caches and keys are appropriate for this policy.
ImageRequest.CacheChoice getCacheChoiceForResult(ImageRequest imageRequest, EncodedImage encodedImage)
Determines the cache in which to store the provided image.
void writeToCache(EncodedImage newResult, ImageRequest imageRequest, Object callerContext)
Writes the new image data to whichever cache and with whichever key is appropriate for this policy.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.facebook.imagepipeline.cache.DiskCachePolicy

Public Constructors

public SmallCacheIfRequestedDiskCachePolicy (BufferedDiskCache defaultBufferedDiskCache, BufferedDiskCache smallImageBufferedDiskCache, CacheKeyFactory cacheKeyFactory)

Public Methods

public Task<EncodedImage> createAndStartCacheReadTask (ImageRequest imageRequest, Object callerContext, AtomicBoolean isCancelled)

Creates and starts the task to carry out a disk cache read, using whichever caches and keys are appropriate for this policy.

public ImageRequest.CacheChoice getCacheChoiceForResult (ImageRequest imageRequest, EncodedImage encodedImage)

Determines the cache in which to store the provided image.

Parameters
imageRequest request which resulted in loading the image
encodedImage the image to store in cache
Returns
  • cache choice that represents the cache to use

public void writeToCache (EncodedImage newResult, ImageRequest imageRequest, Object callerContext)

Writes the new image data to whichever cache and with whichever key is appropriate for this policy.