|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Cache
Cache interface to use for different caching policies.
Cache entries are unambiguously identified through a key, as defined by
CacheObject
.
For comparison of keys, Object.hashCode()
and
Object.equals(Object)
are used.
CacheObject
Nested Class Summary | |
---|---|
static interface |
Cache.Statistic
Offers information about data counting and cache performance. |
Method Summary | |
---|---|
void |
clear()
Empties the cache of all CacheObject s. |
CacheObject |
get(java.lang.Object key)
Gets the CacheObject associated with key from the
cache. |
void |
put(CacheObject obj)
Inserts the CacheObject obj into the cache. |
void |
remove(java.lang.Object key)
Removes the CacheObject associated with key from the cache,
if found. |
void |
removeExpired()
Removes all CacheObject s which are not valid anymore, as defined
by a caching policy, from the cache. |
Cache.Statistic |
statistic()
Returns information collected by this cache since its creation. |
Method Detail |
---|
void clear()
CacheObject
s.
CacheObject get(java.lang.Object key)
CacheObject
associated with key
from the
cache.
If found, the access count of the CacheObject is incremented by 1.
key
- key to search
null
if key
does
not exist in the cachevoid put(CacheObject obj)
CacheObject
obj
into the cache.
If a CacheObject
with an equal key (delivered by
CacheObject.getKey()
) to obj.getKey()
is already
in the cache, it will be replaced by obj
.
CacheObject.resetTimestamp()
is invoked on obj
after
obj
was inserted successfully.
obj
- CacheObject to put into the cachevoid remove(java.lang.Object key)
key
from the cache,
if found.
key
- key of CacheObject to removevoid removeExpired()
CacheObject
s which are not valid anymore, as defined
by a caching policy, from the cache.
Cache.Statistic statistic()
Cache.Statistic
object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |