Constructor and Description |
---|
NoCache() |
Modifier and Type | Method and Description |
---|---|
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 |
isEmpty()
Returns
true if cache is empty. |
boolean |
isFull()
Returns
true if max cache capacity has been reached
only if cache is size limited. |
java.util.Iterator<V> |
iterator()
Returns iterator over non-expired values.
|
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.
|
public int getCacheSize()
Cache
0
if there is no size limit.getCacheSize
in interface Cache<K,V>
public long getCacheTimeout()
Cache
0
if it is not set.getCacheTimeout
in interface Cache<K,V>
public void put(K key, V object)
Cache
put
in interface Cache<K,V>
Cache.put(Object, Object, long)
public void put(K key, V object, long timeout)
Cache
Cache.prune()
is invoked to make room for new object.public V get(K key)
Cache
null
if object
is not longer in cache or if it is expired.public java.util.Iterator<V> iterator()
Cache
public int prune()
Cache
public boolean isFull()
Cache
true
if max cache capacity has been reached
only if cache is size limited.public void remove(K key)
Cache
public void clear()
Cache
public int size()
Cache
Copyright © 2003-2013 Jodd Team