com.nostra13.universalimageloader.core.assist
Class MemoryCacheUtil

java.lang.Object
  extended by com.nostra13.universalimageloader.core.assist.MemoryCacheUtil

public final class MemoryCacheUtil
extends Object

Utility for generating of keys for memory cache, key comparing and other work with memory cache

Since:
1.6.3
Author:
Sergey Tarasevich (nostra13[at]gmail[dot]com)

Method Summary
static Comparator<String> createFuzzyKeyComparator()
           
static List<android.graphics.Bitmap> findCachedBitmapsForImageUri(String imageUri, MemoryCacheAware<String,android.graphics.Bitmap> memoryCache)
          Searches all bitmaps in memory cache which are corresponded to incoming URI.
static List<String> findCacheKeysForImageUri(String imageUri, MemoryCacheAware<String,android.graphics.Bitmap> memoryCache)
          Searches all keys in memory cache which are corresponded to incoming URI.
static String generateKey(String imageUri, ImageSize targetSize)
          Generates key for memory cache for incoming image (URI + size).
static void removeFromCache(String imageUri, MemoryCacheAware<String,android.graphics.Bitmap> memoryCache)
          Removes from memory cache all images for incoming URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

generateKey

public static String generateKey(String imageUri,
                                 ImageSize targetSize)
Generates key for memory cache for incoming image (URI + size).
Pattern for cache key - , where (1) - image URI, (2) - image width, (3) - image height.


createFuzzyKeyComparator

public static Comparator<String> createFuzzyKeyComparator()

findCachedBitmapsForImageUri

public static List<android.graphics.Bitmap> findCachedBitmapsForImageUri(String imageUri,
                                                                         MemoryCacheAware<String,android.graphics.Bitmap> memoryCache)
Searches all bitmaps in memory cache which are corresponded to incoming URI.
Note: Memory cache can contain multiple sizes of the same image if only you didn't set denyCacheImageMultipleSizesInMemory() option in configuration


findCacheKeysForImageUri

public static List<String> findCacheKeysForImageUri(String imageUri,
                                                    MemoryCacheAware<String,android.graphics.Bitmap> memoryCache)
Searches all keys in memory cache which are corresponded to incoming URI.
Note: Memory cache can contain multiple sizes of the same image if only you didn't set denyCacheImageMultipleSizesInMemory() option in configuration


removeFromCache

public static void removeFromCache(String imageUri,
                                   MemoryCacheAware<String,android.graphics.Bitmap> memoryCache)
Removes from memory cache all images for incoming URI.
Note: Memory cache can contain multiple sizes of the same image if only you didn't set denyCacheImageMultipleSizesInMemory() option in configuration



Copyright © 2011-2013. All Rights Reserved.