public class

CountingLruMap

extends Object
java.lang.Object
   ↳ com.facebook.imagepipeline.cache.CountingLruMap<K, V>

Class Overview

Map that keeps track of the elements order (according to the LRU policy) and their size.

Summary

Public Constructors
CountingLruMap(ValueDescriptor<V> valueDescriptor)
Public Methods
synchronized ArrayList<V> clear()
Clears the map.
synchronized boolean contains(K key)
Returns whether the map contains an element with the given key.
synchronized V get(K key)
Gets the element from the map.
synchronized int getCount()
Gets the count of the elements in the map.
synchronized K getFirstKey()
Gets the key of the first element in the map.
synchronized ArrayList<Entry<K, V>> getMatchingEntries(Predicate<K> predicate)
Gets the all matching elements.
synchronized int getSizeInBytes()
Gets the total size in bytes of the elements in the map.
synchronized V put(K key, V value)
Adds the element to the map, and removes the old element with the same key if any.
synchronized V remove(K key)
Removes the element from the map.
synchronized ArrayList<V> removeAll(Predicate<K> predicate)
Removes all the matching elements from the map.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CountingLruMap (ValueDescriptor<V> valueDescriptor)

Public Methods

public synchronized ArrayList<V> clear ()

Clears the map.

public synchronized boolean contains (K key)

Returns whether the map contains an element with the given key.

public synchronized V get (K key)

Gets the element from the map.

public synchronized int getCount ()

Gets the count of the elements in the map.

public synchronized K getFirstKey ()

Gets the key of the first element in the map.

public synchronized ArrayList<Entry<K, V>> getMatchingEntries (Predicate<K> predicate)

Gets the all matching elements.

public synchronized int getSizeInBytes ()

Gets the total size in bytes of the elements in the map.

public synchronized V put (K key, V value)

Adds the element to the map, and removes the old element with the same key if any.

public synchronized V remove (K key)

Removes the element from the map.

public synchronized ArrayList<V> removeAll (Predicate<K> predicate)

Removes all the matching elements from the map.