public interface Cache
Cache
object
A cache must call CacheManager.getInstance().add(this)
to take part in the dynamic memory distribution.Modifier and Type | Method and Description |
---|---|
long |
getAccessCount()
Get the number of accesses (get or set) until resetAccessCount was called.
|
String |
getCacheInfoAsString()
Gathers the stats of the cache for logging.
|
long |
getElementCount()
Get the number of elements/objects in the cache.
|
long |
getMaxMemorySize()
Get the current limit.
|
long |
getMemoryUsed()
Get the amount of used memory.
|
long |
getMissCount()
Get the number of cache misses.
|
long |
getTotalAccessCount()
Get the total number of cache accesses.
|
void |
resetAccessCount()
Reset the access counter.
|
void |
resetMissCount()
Reset the cache miss counter.
|
void |
setAccessListener(CacheAccessListener listener)
Add a listener to this cache that is informed after a number of accesses.
|
void |
setMaxMemorySize(long size)
Set the new memory limit.
|
void setMaxMemorySize(long size)
size
- the size in byteslong getMaxMemorySize()
long getMemoryUsed()
long getAccessCount()
void resetAccessCount()
long getTotalAccessCount()
long getMissCount()
void resetMissCount()
long getElementCount()
void setAccessListener(CacheAccessListener listener)
String getCacheInfoAsString()
Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.