Code example for LruCache

Methods: getputremove

4
	} 
 
	public Bitmap getBitmap(long key) {
		Bitmap bm = getFolderBitmap(key);
		if (bm != null) return bm;
		return mContentCache.get(key);
	} 
	 
	public void clearAll() { 
		clearContent(); 
		clearFolder(); 
	} 
	 
	public void clearContent() { 
		mContentCache.evictAll();
	} 
	 
	public void clearFolder() { 
		mFolderCache.evictAll();
	} 
	 
	public void putFolderBitmap(long key, Bitmap bm) {
		mFolderCache.put(key, bm);
	} 
	 
	public Bitmap getFolderBitmap(long key) {
		return mFolderCache.get(key);
	} 
 
	public void rotateBitmap(int rotation, long key) {
		Bitmap bm = getBitmap(key);
    	if (bm != null) {
    		Bitmap newBitmap = MediaLoader.rotateBitmap(bm, rotation, false);
    		if (mFolderCache.remove(key) != null) {
    			mFolderCache.put(key, newBitmap);
    		} else { 
    			if (mContentCache.remove(key) != null) {
    				mContentCache.put(key, newBitmap);
    			} 
    		} 
    	} 
	} 
}