K
- The key of the cacheV
- The values in the cachepublic class LRUCacheCheapRead<K,V> extends LRUCache<K,V>
Constructor and Description |
---|
LRUCacheCheapRead(int maxCacheSize)
Create new cache with given maximum capacity.
|
Modifier and Type | Method and Description |
---|---|
V |
get(K key)
Returns the value associated with the given key.
|
int |
getMaxCacheSize()
Returns the maximum number of entries that will be stored in this cache
|
CacheEntry |
put(K key,
V value)
Adds the given key and value pair into the cache
|
void |
releaseCache()
Clears all entries in the cache, for use when a known event makes the cache incorrect
|
void |
releaseMatching(CacheKeyFilter<K> filter)
This method will remove all cache entries for which this filter
matches
|
createCache
public LRUCacheCheapRead(int maxCacheSize)
maxCacheSize
- Maximum number of items to keep.public V get(K key)
LRUCache
public CacheEntry put(K key, V value)
LRUCache
public void releaseCache()
LRUCache
releaseCache
in class LRUCache<K,V>
public int getMaxCacheSize()
LRUCache
getMaxCacheSize
in class LRUCache<K,V>
public void releaseMatching(CacheKeyFilter<K> filter)
LRUCache
releaseMatching
in class LRUCache<K,V>
filter
- Entries in the cache that match this filter will
be removed from the cache. If filter is null nothing
will be removed from the cacheCopyright © 2009-2017, Oracle and/or its affiliates. All Rights Reserved.