public class

BucketMap

extends Object
java.lang.Object
   ↳ com.facebook.imagepipeline.memory.BucketMap<T>

Class Overview

Map-like datastructure that allows to have more than one value per int key. Allows to remove a value from LRU key by calling removeFromEnd()

Summary

Fields
protected final SparseArray<LinkedEntry<T>> mMap
Public Constructors
BucketMap()
Public Methods
synchronized T acquire(int key)
synchronized void release(int key, T value)
Associates the object with the specified key and puts it into the BucketMap.
synchronized T removeFromEnd()
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected final SparseArray<LinkedEntry<T>> mMap

Public Constructors

public BucketMap ()

Public Methods

public synchronized T acquire (int key)

Returns
  • Retrieve an object that corresponds to the specified key if present in the BucketMap or null otherwise

public synchronized void release (int key, T value)

Associates the object with the specified key and puts it into the BucketMap. Does not overwrite the previous object, if any.

public synchronized T removeFromEnd ()