|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache
public class LruMemoryCache
A cache that holds strong references to a limited number of Bitmaps. Each time a Bitmap is accessed, it is moved to
the head of a queue. When a Bitmap is added to a full cache, the Bitmap at the end of that queue is evicted and may
become eligible for garbage collection.
NOTE: This cache uses only strong references for stored Bitmaps.
Constructor Summary | |
---|---|
LruMemoryCache(int maxSize)
|
Method Summary | |
---|---|
void |
clear()
Remove all items from cache |
android.graphics.Bitmap |
get(String key)
Returns the Bitmap for key if it exists in the cache. |
Collection<String> |
keys()
Returns all keys of cache |
boolean |
put(String key,
android.graphics.Bitmap value)
Caches Bitmap for key . |
android.graphics.Bitmap |
remove(String key)
Removes the entry for key if it exists. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LruMemoryCache(int maxSize)
maxSize
- Maximum sum of the sizes of the Bitmaps in this cacheMethod Detail |
---|
public final android.graphics.Bitmap get(String key)
key
if it exists in the cache. If a Bitmap was returned, it is moved to the head
of the queue. This returns null if a Bitmap is not cached.
get
in interface MemoryCacheAware<String,android.graphics.Bitmap>
public final boolean put(String key, android.graphics.Bitmap value)
Bitmap
for key
. The Bitmap is moved to the head of the queue.
put
in interface MemoryCacheAware<String,android.graphics.Bitmap>
public final android.graphics.Bitmap remove(String key)
key
if it exists.
remove
in interface MemoryCacheAware<String,android.graphics.Bitmap>
public Collection<String> keys()
MemoryCacheAware
keys
in interface MemoryCacheAware<String,android.graphics.Bitmap>
public void clear()
MemoryCacheAware
clear
in interface MemoryCacheAware<String,android.graphics.Bitmap>
public final String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |