Back to Fresco

AnimatedFrameCache

docs/javadoc/reference/com/facebook/imagepipeline/animated/impl/AnimatedFrameCache.html

3.6.015.4 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Packages | Classes

Summary: Ctors | Methods | Inherited Methods | [Expand All]

public class

AnimatedFrameCache

extends Object

| java.lang.Object | | ↳ | com.facebook.imagepipeline.animated.impl.AnimatedFrameCache |

Class Overview

Facade to the image memory cache for frames of an animated image.

Each animated image should have its own instance of this class.

Summary

Public Constructors
Public Methods
CloseableReference<CloseableImage>
Caches the image for the given frame index.
boolean
Check whether the cache contains an image for the given frame index.
CloseableReference<CloseableImage>
Gets the image for the given frame index.
CloseableReference<CloseableImage>
Gets the image to be reused, or null if there is no such image.
synchronized void

| [Expand] Inherited Methods | | --- | | From class java.lang.Object

| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

|

Public Constructors

public AnimatedFrameCache(CacheKey imageCacheKey, CountingMemoryCache<CacheKey, CloseableImage> backingCache)

Public Methods

public CloseableReference<CloseableImage> cache(int frameIndex, CloseableReference<CloseableImage> imageRef)

Caches the image for the given frame index.

Important: the client should use the returned reference instead of the original one. It is the caller's responsibility to close the returned reference once not needed anymore.

Returns
  • the new reference to be used, null if the value cannot be cached

public boolean contains(int frameIndex)

Check whether the cache contains an image for the given frame index.

public CloseableReference<CloseableImage> get(int frameIndex)

Gets the image for the given frame index.

It is the caller's responsibility to close the returned reference once not needed anymore.

public CloseableReference<CloseableImage> getForReuse()

Gets the image to be reused, or null if there is no such image.

The returned image is the least recently used image that has no more clients referencing it, and it has not yet been evicted from the cache.

The client can freely modify the bitmap of the returned image and can cache it again without any restrictions.

public synchronized void onReusabilityChange(CacheKey key, boolean isReusable)

+Generated by Doclava. +