K - the key type. This must have both Object.equals(Object)
and Object.hashCode() correctly implemented.V - the value type. It is generally recommended to use an immutable
type here, but this is not required.X - the type of exception thrown. If no exception will be throws, use
NeverThrownRuntimeException.public interface ICache<K,V,X extends java.lang.Exception>
IParameterizedFactory with additional hit/miss statistics.| Modifier and Type | Method and Description |
|---|---|
void |
clear(boolean allThreads)
Clears the cache, i.e.
|
int |
getHits()
Returns the number of cache hits so far.
|
long |
getMissCostMillis()
Returns an estimation of the overhead caused by cache misses in
milliseconds.
|
int |
getMisses()
Returns the number of cache misses so far.
|
java.lang.String |
getName()
Returns the name (used for reporting).
|
V |
obtain(K key)
Obtain the value for a key.
|
V obtain(K key) throws X extends java.lang.Exception
X extends java.lang.Exceptionvoid clear(boolean allThreads)
allThreads - if this is true, data will be discarded for all threads,
otherwise only data for the current thread will be cleaned (if
possible).java.lang.String getName()
int getHits()
int getMisses()
long getMissCostMillis()