public interface Cache<K,V>
Modifier and Type | Method and Description |
---|---|
void |
clear()
clear cache
|
boolean |
containsKey(K key)
whether key is in cache
|
java.util.Set<java.util.Map.Entry<K,CacheObject<V>>> |
entrySet()
key value set
|
CacheObject<V> |
get(K key)
get object
|
double |
getHitRate()
get hit rate
|
int |
getSize()
get object in cache
|
java.util.Set<K> |
keySet()
key set
|
CacheObject<V> |
put(K key,
CacheObject<V> value)
put object
|
CacheObject<V> |
put(K key,
V value)
put object
|
void |
putAll(Cache<K,V> cache2)
put all object in cache2
|
CacheObject<V> |
remove(K key)
remove object
|
java.util.Collection<CacheObject<V>> |
values()
value set
|
int getSize()
CacheObject<V> get(K key)
key
- CacheObject<V> put(K key, V value)
key
- keyvalue
- data in object, CacheObject.getData()
CacheObject<V> put(K key, CacheObject<V> value)
key
- keyvalue
- objectboolean containsKey(K key)
key
- CacheObject<V> remove(K key)
key
- void clear()
double getHitRate()
java.util.Set<K> keySet()
java.util.Set<java.util.Map.Entry<K,CacheObject<V>>> entrySet()
java.util.Collection<CacheObject<V>> values()