public class

BitmapCounter

extends Object
java.lang.Object
   ↳ com.facebook.imagepipeline.memory.BitmapCounter

Class Overview

Counts bitmaps - keeps track of both, count and total size in bytes.

Summary

Public Constructors
BitmapCounter(int maxCount, int maxSize)
Public Methods
synchronized void decrease(Bitmap bitmap)
Excludes given bitmap from the count.
synchronized int getCount()
synchronized int getMaxCount()
synchronized int getMaxSize()
ResourceReleaser<Bitmap> getReleaser()
synchronized long getSize()
synchronized boolean increase(Bitmap bitmap)
Includes given bitmap in the bitmap count.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public BitmapCounter (int maxCount, int maxSize)

Public Methods

public synchronized void decrease (Bitmap bitmap)

Excludes given bitmap from the count.

Parameters
bitmap to be excluded from the count

public synchronized int getCount ()

Returns
  • number of counted bitmaps

public synchronized int getMaxCount ()

public synchronized int getMaxSize ()

public ResourceReleaser<Bitmap> getReleaser ()

public synchronized long getSize ()

Returns
  • total size in bytes of counted bitmaps

public synchronized boolean increase (Bitmap bitmap)

Includes given bitmap in the bitmap count. The bitmap is included only if doing so does not violate configured limit

Parameters
bitmap to include in the count
Returns
  • true if and only if bitmap is successfully included in the count