|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.intarsys.tools.cache.CacheEntry<T>
public class CacheEntry<T>
An entry in the cache implementation.
A cache entries "importance" is expressed by a "sample". The CacheEntry with the smallest sample is considered the least valuable.
This implementation supports a simple "most recently used" strategy.
Constructor Summary | |
---|---|
protected |
CacheEntry(java.lang.Object key,
T value)
Create a cache entry. |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object o)
|
java.lang.Object |
getKey()
The key of the cache entry. |
int |
getSample()
The sample representing the "importance" of the entry. |
T |
getValue()
The value of the cache entry. |
protected void |
touch()
Mark the Cache entry as recently used. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected CacheEntry(java.lang.Object key, T value)
key
- The key for the entryvalue
- The value for the entryMethod Detail |
---|
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public java.lang.Object getKey()
public int getSample()
public T getValue()
protected void touch()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |