|
||||||||||
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(java.lang.String key)
Returns the Bitmap for key if it exists in the cache. |
java.util.Collection<java.lang.String> |
keys()
Returns all keys of cache |
boolean |
put(java.lang.String key,
android.graphics.Bitmap value)
Caches Bitmap for key . |
void |
remove(java.lang.String key)
Removes the entry for key if it exists. |
java.lang.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(java.lang.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<java.lang.String,android.graphics.Bitmap>
public final boolean put(java.lang.String key, android.graphics.Bitmap value)
Bitmap
for key
. The Bitmap is moved to the head of the queue.
put
in interface MemoryCacheAware<java.lang.String,android.graphics.Bitmap>
public final void remove(java.lang.String key)
key
if it exists.
remove
in interface MemoryCacheAware<java.lang.String,android.graphics.Bitmap>
public java.util.Collection<java.lang.String> keys()
MemoryCacheAware
keys
in interface MemoryCacheAware<java.lang.String,android.graphics.Bitmap>
public void clear()
MemoryCacheAware
clear
in interface MemoryCacheAware<java.lang.String,android.graphics.Bitmap>
public final java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |