com.duowan.mobile.netroid.cache
Class BitmapImageCache

java.lang.Object
  extended by com.duowan.mobile.netroid.cache.LruCache<java.lang.String,android.graphics.Bitmap>
      extended by com.duowan.mobile.netroid.cache.BitmapImageCache
All Implemented Interfaces:
ImageLoader.ImageCache

public class BitmapImageCache
extends LruCache<java.lang.String,android.graphics.Bitmap>
implements ImageLoader.ImageCache


Constructor Summary
BitmapImageCache(int maxSize)
           
 
Method Summary
 android.graphics.Bitmap getBitmap(java.lang.String url)
           
 void putBitmap(java.lang.String url, android.graphics.Bitmap bitmap)
           
protected  int sizeOf(java.lang.String key, android.graphics.Bitmap value)
          Returns the size of the entry for key and value in user-defined units.
 
Methods inherited from class com.duowan.mobile.netroid.cache.LruCache
create, createCount, entryRemoved, evictAll, evictionCount, get, hitCount, maxSize, missCount, put, putCount, remove, size, snapshot, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BitmapImageCache

public BitmapImageCache(int maxSize)
Method Detail

sizeOf

protected int sizeOf(java.lang.String key,
                     android.graphics.Bitmap value)
Description copied from class: LruCache
Returns the size of the entry for key and value in user-defined units. The default implementation returns 1 so that size is the number of entries and max size is the maximum number of entries.

An entry's size must not change while it is in the cache.

Overrides:
sizeOf in class LruCache<java.lang.String,android.graphics.Bitmap>

getBitmap

public android.graphics.Bitmap getBitmap(java.lang.String url)
Specified by:
getBitmap in interface ImageLoader.ImageCache

putBitmap

public void putBitmap(java.lang.String url,
                      android.graphics.Bitmap bitmap)
Specified by:
putBitmap in interface ImageLoader.ImageCache