Package | Description |
---|---|
cn.trinea.android.common.service | |
cn.trinea.android.common.service.impl |
Modifier and Type | Method and Description |
---|---|
void |
Cache.putAll(Cache<K,V> cache2)
put all object in cache2
|
Modifier and Type | Class and Description |
---|---|
class |
ImageCache
Image Cache
It's a cache with primary cache and secondary cache. |
class |
ImageMemoryCache
Image Memory Cache
It applies to images those uesd frequently, like users avatar of twitter or sina weibo. |
class |
ImageSDCardCache
Image SDCard Cache
It applies to images those uesd frequently and their size is big that we cannot store too much in memory, like pictures of twitter or sina weibo. |
class |
PreloadDataCache<K,V>
Preload data cache, It a good choice for network application which need to preload data.
|
class |
SimpleCache<K,V>
Simple Cache
Usage Use one of constructors below to construct cache SimpleCache.setCacheFullRemoveType(CacheFullRemoveType) set remove type when cache is full
SimpleCache.setValidTime(long) set valid time of elements in cache, in mills
SimpleCache.put(Object, CacheObject) or SimpleCache.put(Object, Object) put element
SimpleCache.get(Object) get element
SimpleCache.loadCache(String) restore cache from file
SimpleCache.saveCache(String, SimpleCache) save cache to file
Constructor
SimpleCache.SimpleCache()
SimpleCache.SimpleCache(int)
SimpleCache.loadCache(String) restore cache from file
About hit and miss of the cache
SimpleCache.getHitRate() get hit rate of the cache
SimpleCache.getHitCount() get hit count of the cache
SimpleCache.getMissCount() get miss count of the cache
About size of cache
SimpleCache.getMaxSize() get the maximum capacity of the cache
SimpleCache.getSize() get the number of elements in the cache valid
Other interfaces same to Map
|
Modifier and Type | Method and Description |
---|---|
void |
SimpleCache.putAll(Cache<K,V> cache2)
pull all elements of cache2 to this
|