docs/javadoc/reference/com/facebook/imagepipeline/cache/LruCountingMemoryCache.html
|
|
CountingMemoryCache<K, V>
MemoryCache<K, V>
Summary: Fields | Ctors | Methods | Inherited Methods | [Expand All]
public class
extends Object
implements HasDebugDataCountingMemoryCache<K, V> MemoryCache<K, V>
| java.lang.Object | | ↳ | com.facebook.imagepipeline.cache.LruCountingMemoryCache<K, V> |
Layer of memory cache stack responsible for managing eviction of the the cached items.
This layer is responsible for LRU eviction strategy and for maintaining the size boundaries of the cached items.
Only the exclusively owned elements, i.e. the elements not referenced by any client, can be evicted.
| Fields |
|---|
| protected MemoryCacheParams |
| Public Constructors |
|---|
| Public Methods |
|---|
| CloseableReference<V> |
| Caches the given key-value pair. |
| CloseableReference<V> |
| Caches the given key-value pair. |
| void |
| Removes all the items from the cache. |
| synchronized boolean |
| Check if an item with the given cache key is currently in the cache. |
| synchronized boolean |
| Check if any items from the cache whose key matches the specified predicate. |
| CloseableReference<V> |
| Gets the item with the given key, or null if there is no such item. |
| CountingLruMap<K, Entry<K, V>> |
| synchronized int |
| Gets the total number of all currently cached items. |
| synchronized String |
| Return a string describing this object and to be used for debugging or logging |
| synchronized int |
| Gets the number of the exclusively owned items. |
| synchronized int |
| Gets the total size in bytes of the exclusively owned items. |
| synchronized int |
| Gets the number of the cached items that are used by at least one client. |
| synchronized int |
| Gets the total size in bytes of the cached items that are used by at least one client. |
| MemoryCacheParams |
| Map<Bitmap, Object> |
| synchronized int |
| Gets the total size in bytes of all currently cached items. |
| void |
| Removes the exclusively owned items until the cache constraints are met. |
| void |
| Probes whether the object corresponding to the key is in the cache. |
| int |
| Removes all the items from the cache whose key matches the specified predicate. |
| CloseableReference<V> |
| Gets the value with the given key to be reused, or null if there is no such value. |
| void |
| Trims the cache according to the specified trimming strategy and the given trim type. |
| [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() |
| | From interface com.facebook.cache.common.HasDebugData
| abstract String | getDebugData() Return a string describing this object and to be used for debugging or logging |
| | From interface com.facebook.common.memory.MemoryTrimmable
| abstract void | trim(MemoryTrimType trimType) Trim memory. |
| | From interface com.facebook.imagepipeline.cache.CountingMemoryCache
| abstract CloseableReference<V> | cache(K key, CloseableReference<V> valueRef, EntryStateObserver<K> observer) | | abstract void | clear() Removes all the items from the cache. | | abstract CountingLruMap<K, Entry<K, V>> | getCachedEntries() | | abstract int | getEvictionQueueCount() Gets the total size in bytes of the cached items that are used by at least one client. | | abstract int | getEvictionQueueSizeInBytes() Gets the total size in bytes of the exclusively owned items. | | abstract int | getInUseSizeInBytes() Gets the total size in bytes of the cached items that are used by at least one client. | | abstract MemoryCacheParams | getMemoryCacheParams() | | abstract Map<Bitmap, Object> | getOtherEntries() | | abstract void | maybeEvictEntries() Removes the exclusively owned items until the cache constraints are met. | | abstract CloseableReference<V> | reuse(K key) |
| | From interface com.facebook.imagepipeline.cache.MemoryCache
| abstract CloseableReference<V> | cache(K key, CloseableReference<V> value) Caches the the given key-value pair. | | abstract boolean | contains(K key) Check if the cache contains an item for the given key. | | abstract boolean | contains(Predicate<K> predicate) Find if any of the items from the cache whose keys match the specified predicate. | | abstract CloseableReference<V> | get(K key) Gets the item with the given key, or null if there is no such item. | | abstract int | getCount() Gets the total number of all currently cached items. | | abstract int | getSizeInBytes() Gets the total size in bytes of all currently cached items. | | abstract void | probe(K key) Probes whether the object corresponding to the key is in the cache. | | abstract int | removeAll(Predicate<K> predicate) Removes all the items from the cache whose keys match the specified predicate. |
|
Caches the given key-value pair.
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.
Caches the given key-value pair.
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.
Removes all the items from the cache.
Check if an item with the given cache key is currently in the cache.
| key | returns true if an item with the given key matches |
Check if any items from the cache whose key matches 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.
It is the caller's responsibility to close the returned reference once not needed anymore.
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 number of the exclusively owned items.
Gets the total size in bytes of the exclusively owned items.
Gets the number of the cached items that are used by at least one client.
Gets the total size in bytes of the cached items that are used by at least one client.
Gets the total size in bytes of all currently cached items.
Removes the exclusively owned items until the cache constraints are met.
This method invokes the external close() method, so it must not be called while holding the this lock.
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 key matches the specified predicate.
| predicate | returns true if an item with the given key should be removed |
Gets the value with the given key to be reused, or null if there is no such value.
The item can be reused only if it is exclusively owned by the cache.
Trims the cache according to the specified trimming strategy and the given trim type.
+Generated by Doclava. +