T - is the Class of object to cache.public class DualCache<T>
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(java.lang.String key)
Test if an object is present in cache.
|
void |
delete(java.lang.String key)
Delete the corresponding object in cache.
|
T |
get(java.lang.String key)
Return the object of the corresponding key from the cache.
|
DualCacheDiskMode |
getDiskMode()
Return the way objects are cached in disk layer.
|
long |
getDiskUsedInBytes() |
DualCacheRamMode |
getRAMMode()
Return the way objects are cached in RAM layer.
|
long |
getRamUsedInBytes() |
void |
invalidate()
Remove all objects from cache (both RAM and disk).
|
void |
invalidateDisk()
Remove all objects from Disk.
|
void |
invalidateRAM()
Remove all objects from RAM.
|
void |
put(java.lang.String key,
T object)
Put an object in cache.
|
public long getRamUsedInBytes()
public long getDiskUsedInBytes()
public DualCacheRamMode getRAMMode()
public DualCacheDiskMode getDiskMode()
public void put(java.lang.String key,
T object)
key - is the key of the object.object - is the object to put in cache.public T get(java.lang.String key)
key - is the key of the object.public void delete(java.lang.String key)
key - is the key of the object.public void invalidate()
public void invalidateRAM()
public void invalidateDisk()
public boolean contains(java.lang.String key)
key - is the key of the object.