public abstract class LRUCache<K,V> extends Object
Constructor and Description |
---|
LRUCache() |
Modifier and Type | Method and Description |
---|---|
static <K,V> LRUCache<K,V> |
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
|
public static <K,V> LRUCache<K,V> createCache(int maxCacheSize)
maxCacheSize
- The maximum number of entries in the cache, must be greater than 2public abstract V get(K key)
key
- Must be a non-null key, appropriate for use as the key to a hash mappublic 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 valuepublic abstract void releaseCache()
public abstract int getMaxCacheSize()
Copyright © 2015 Oracle Corporation. All rights reserved.