| Modifier and Type | Class and Description |
|---|---|
static class |
DiskLruBasedCache.ImageCacheParams
A holder class that contains cache parameters.
|
Cache.Entry| Constructor and Description |
|---|
DiskLruBasedCache(DiskLruBasedCache.ImageCacheParams cacheParams) |
DiskLruBasedCache(java.io.File root) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Empties the cache.
|
void |
clearCache() |
void |
close()
Closes the disk cache associated with this ImageCache object.
|
boolean |
containsKey(java.lang.String key) |
void |
flush()
Flushes the disk cache associated with this ImageCache object.
|
Cache.Entry |
get(java.lang.String data)
Retrieves an entry from the cache.
|
android.graphics.Bitmap |
getBitmap(java.lang.String data) |
java.io.File |
getCacheFolder() |
java.io.File |
getFileForKey(java.lang.String key)
Returns a file object for the given cache key.
|
static java.lang.String |
hashKeyForDisk(java.lang.String key)
A hashing method that changes a string (like a URL) into a hash suitable for using as a
disk filename.
|
void |
initDiskCache()
Initializes the disk cache.
|
void |
initialize()
Performs any potentially long-running actions needed to initialize the cache;
will be called from a worker thread.
|
void |
invalidate(java.lang.String key,
boolean fullExpire)
Invalidates an entry in the cache.
|
void |
put(java.lang.String data,
Cache.Entry value)
Adds or replaces an entry to the cache.
|
void |
putBitmap(java.lang.String data,
android.graphics.Bitmap value) |
void |
remove(java.lang.String data)
Removes an entry from the cache.
|
public DiskLruBasedCache(java.io.File root)
public DiskLruBasedCache(DiskLruBasedCache.ImageCacheParams cacheParams)
public void putBitmap(java.lang.String data,
android.graphics.Bitmap value)
public android.graphics.Bitmap getBitmap(java.lang.String data)
public boolean containsKey(java.lang.String key)
public void clearCache()
public java.io.File getCacheFolder()
public void initDiskCache()
public static java.lang.String hashKeyForDisk(java.lang.String key)
public java.io.File getFileForKey(java.lang.String key)
public Cache.Entry get(java.lang.String data)
Cacheget in interface Cachedata - Cache keyCache.Entry or null in the event of a cache misspublic void put(java.lang.String data,
Cache.Entry value)
Cachepublic void initialize()
Cacheinitialize in interface Cachepublic void invalidate(java.lang.String key,
boolean fullExpire)
Cacheinvalidate in interface Cachekey - Cache keyfullExpire - True to fully expire the entry, false to soft expirepublic void remove(java.lang.String data)
Cachepublic void clear()
Cachepublic void flush()