-
- All Implemented Interfaces:
-
com.mobwith.imgmodule.load.engine.cache.MemoryCache
public class LruResourceCache extends LruCache<Key, Resource<out Object>> implements MemoryCache
An LRU in memory cache for com.mobwith.imgmodule.load.engine.Resources.
-
-
Constructor Summary
Constructors Constructor Description LruResourceCache(long size)Constructor for LruResourceCache.
-
Method Summary
Modifier and Type Method Description voidsetResourceRemovedListener(@NonNull() MemoryCache.ResourceRemovedListener listener)Set the listener to be called when a bitmap is removed from the cache. voidtrimMemory(int level)Trim the memory cache to the appropriate level. -
Methods inherited from class com.mobwith.imgmodule.util.LruCache
clearMemory, contains, get, getCurrentSize, getMaxSize, put, remove, setSizeMultiplier -
Methods inherited from class com.mobwith.imgmodule.load.engine.cache.MemoryCache
put, remove -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
setResourceRemovedListener
void setResourceRemovedListener(@NonNull() MemoryCache.ResourceRemovedListener listener)
Set the listener to be called when a bitmap is removed from the cache.
- Parameters:
listener- The listener.
-
trimMemory
void trimMemory(int level)
Trim the memory cache to the appropriate level. Typically called on the callback onTrimMemory.
- Parameters:
level- This integer represents a trim level as specified in .
-
-
-
-