|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.hk2.utilities.cache.LRUCache<K,V>
public abstract class LRUCache<K,V>
A cache that contains a certain number of entries, and whose oldest accessed entries are removed when removal is necessary.
| Constructor Summary | |
|---|---|
LRUCache()
|
|
| Method Summary | ||
|---|---|---|
static
|
createCache(int maxCacheSize)
Creates a cache with the given maximum cache size |
|
abstract V |
get(K key)
Returns the value associated with the given key. |
|
abstract int |
getMaxCacheSize()
Returns the maximum number of entries that will be stored in this cache |
|
abstract CacheEntry |
put(K key,
V value)
Adds the given key and value pair into the cache |
|
abstract void |
releaseCache()
Clears all entries in the cache, for use when a known event makes the cache incorrect |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LRUCache()
| Method Detail |
|---|
public static <K,V> LRUCache<K,V> createCache(int maxCacheSize)
maxCacheSize - The maximum number of entries in the cache, must be greater than 2
public abstract V get(K key)
key - Must be a non-null key, appropriate for use as the key to a hash map
public abstract CacheEntry put(K key,
V value)
key - Must be a non-null key, appropriate for use as the key to a hash mapvalue - Must be a non-null value
public abstract void releaseCache()
public abstract int getMaxCacheSize()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||