com.nostra13.universalimageloader.utils
Class MemoryCacheUtils

java.lang.Object
  extended by com.nostra13.universalimageloader.utils.MemoryCacheUtils

public final class MemoryCacheUtils
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, MemoryCache memoryCache)
          Searches all bitmaps in memory cache which are corresponded to incoming URI.
static List<String> findCacheKeysForImageUri(String imageUri, MemoryCache 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, MemoryCache 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 - [imageUri]_[width]x[height].


createFuzzyKeyComparator

public static Comparator<String> createFuzzyKeyComparator()

findCachedBitmapsForImageUri

public static List<android.graphics.Bitmap> findCachedBitmapsForImageUri(String imageUri,
                                                                         MemoryCache 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,
                                                    MemoryCache 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,
                                   MemoryCache 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-2014. All Rights Reserved.