|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Cache<K,V>
Cache interface.
Method Summary | |
---|---|
void |
clear()
Clears current cache. |
V |
get(K key)
Retrieves an object from the cache. |
int |
getCacheSize()
Returns cache size or 0 if there is no size limit. |
long |
getCacheTimeout()
Returns default timeout or 0 if it is not set. |
boolean |
isFull()
Returns true if max cache capacity has been reached
only if cache is size limited. |
int |
prune()
Prunes objects from cache and returns the number of removed objects. |
void |
put(K key,
V object)
Adds an object to the cache with default timeout. |
void |
put(K key,
V object,
long timeout)
Adds an object to the cache with specified timeout after which it becomes expired. |
void |
remove(K key)
Removes an object from the cache. |
int |
size()
Returns current cache size. |
Method Detail |
---|
int getCacheSize()
0
if there is no size limit.
long getCacheTimeout()
0
if it is not set.
void put(K key, V object)
put(Object, Object, long)
void put(K key, V object, long timeout)
V get(K key)
null
if object
is not longer in cache or if it is expired.
int prune()
boolean isFull()
true
if max cache capacity has been reached
only if cache is size limited.
void remove(K key)
void clear()
int size()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |