|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bumptech.glide.util.LruCache<Key,Resource<?>> com.bumptech.glide.load.engine.cache.LruResourceCache
public class LruResourceCache
An LRU in memory cache for Resource
s.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.bumptech.glide.load.engine.cache.MemoryCache |
---|
MemoryCache.ResourceRemovedListener |
Constructor Summary | |
---|---|
LruResourceCache(int size)
Constructor for LruResourceCache. |
Method Summary | |
---|---|
protected int |
getSize(Resource<?> item)
Returns the size of a given item, defaulting to one. |
protected void |
onItemEvicted(Key key,
Resource<?> item)
A callback called whenever an item is evicted from the cache. |
void |
setResourceRemovedListener(MemoryCache.ResourceRemovedListener listener)
Set the listener to be called when a bitmap is removed from the cache. |
void |
trimMemory(int level)
Trim the memory cache to the appropriate level. |
Methods inherited from class com.bumptech.glide.util.LruCache |
---|
clearMemory, contains, get, getCurrentSize, getMaxSize, put, remove, setSizeMultiplier, trimToSize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.bumptech.glide.load.engine.cache.MemoryCache |
---|
clearMemory, getCurrentSize, getMaxSize, put, remove, setSizeMultiplier |
Constructor Detail |
---|
public LruResourceCache(int size)
size
- The maximum size in bytes the in memory cache can use.Method Detail |
---|
public void setResourceRemovedListener(MemoryCache.ResourceRemovedListener listener)
MemoryCache
setResourceRemovedListener
in interface MemoryCache
listener
- The listener.protected void onItemEvicted(Key key, Resource<?> item)
LruCache
onItemEvicted
in class LruCache<Key,Resource<?>>
key
- The key of the evicted item.item
- The evicted item.protected int getSize(Resource<?> item)
LruCache
getSize
in class LruCache<Key,Resource<?>>
item
- The item to get the size of.public void trimMemory(int level)
MemoryCache
trimMemory
in interface MemoryCache
level
- This integer represents a trim level as specified in ComponentCallbacks2
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |