java.lang.Object | |
↳ | com.facebook.imagepipeline.cache.InstrumentedMemoryCache<K, V> |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
InstrumentedMemoryCache(MemoryCache<K, V> delegate, MemoryCacheTracker tracker) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CloseableReference<V> |
cache(K key, CloseableReference<V> value)
Caches the the given key-value pair.
| ||||||||||
boolean |
contains(K key)
Check if the cache contains an item for the given key.
| ||||||||||
boolean |
contains(Predicate<K> predicate)
Find if any of the items from the cache whose keys match the specified predicate.
| ||||||||||
CloseableReference<V> |
get(K key)
Gets the item with the given key, or null if there is no such item.
| ||||||||||
int |
getCount()
Gets the total number of all currently cached items.
| ||||||||||
String |
getDebugData()
Return a string describing this object and to be used for debugging or logging
| ||||||||||
int |
getSizeInBytes()
Gets the total size in bytes of all currently cached items.
| ||||||||||
void |
probe(K key)
Probes whether the object corresponding to the key is in the cache.
| ||||||||||
int |
removeAll(Predicate<K> predicate)
Removes all the items from the cache whose keys match the specified predicate.
| ||||||||||
void |
trim(MemoryTrimType trimType)
Trim memory.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.facebook.cache.common.HasDebugData
| |||||||||||
From interface
com.facebook.common.memory.MemoryTrimmable
| |||||||||||
From interface
com.facebook.imagepipeline.cache.MemoryCache
|
Caches the the given key-value pair.
The cache returns a new copy of the provided reference which should be used instead of the original one. The client should close the returned reference when it is not required anymore.
If the cache failed to cache the given value, then the null reference is returned.
Check if the cache contains an item for the given key.
Find if any of the items from the cache whose keys match the specified predicate.
predicate | returns true if an item with the given key matches |
---|
Gets the item with the given key, or null if there is no such item.
Gets the total number of all currently cached items.
Return a string describing this object and to be used for debugging or logging
Gets the total size in bytes of all currently cached items.
Probes whether the object corresponding to the key is in the cache. Note that the act of probing touches the item (if present in cache), thus changing its LRU timestamp.
Removes all the items from the cache whose keys match the specified predicate.
predicate | returns true if an item with the given key should be removed |
---|