com.nostra13.universalimageloader.core.assist
Class MemoryCacheUtil

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

public final class MemoryCacheUtil
extends java.lang.Object

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

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

Method Summary
static java.util.Comparator<java.lang.String> createFuzzyKeyComparator()
           
static java.util.List<android.graphics.Bitmap> findCachedBitmapsForImageUri(java.lang.String imageUri, MemoryCacheAware<java.lang.String,android.graphics.Bitmap> memoryCache)
          Searches all bitmaps in memory cache which are corresponded to incoming URI.
static java.util.List<java.lang.String> findCacheKeysForImageUri(java.lang.String imageUri, MemoryCacheAware<java.lang.String,android.graphics.Bitmap> memoryCache)
          Searches all keys in memory cache which are corresponded to incoming URI.
static java.lang.String generateKey(java.lang.String imageUri, ImageSize targetSize)
          Generates key for memory cache for incoming image (URI + size).
static void removeFromCache(java.lang.String imageUri, MemoryCacheAware<java.lang.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 java.lang.String generateKey(java.lang.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 java.util.Comparator<java.lang.String> createFuzzyKeyComparator()

findCachedBitmapsForImageUri

public static java.util.List<android.graphics.Bitmap> findCachedBitmapsForImageUri(java.lang.String imageUri,
                                                                                   MemoryCacheAware<java.lang.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 java.util.List<java.lang.String> findCacheKeysForImageUri(java.lang.String imageUri,
                                                                        MemoryCacheAware<java.lang.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(java.lang.String imageUri,
                                   MemoryCacheAware<java.lang.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.