[Java] Class LRUCache<K, V>
- org.codehaus.groovy.runtime.memoize.LRUCache
- All Implemented Interfaces and Traits:
- MemoizeCache
@ThreadSafe public final class LRUCache extends Object
A cache backed by a ConcurrentLinkedHashMap
Constructor Summary
Constructor and description |
---|
LRUCache
(int maxCacheSize) |
Methods Summary
Type Params | Return Type | Name and description |
---|---|---|
void |
cleanUpNullReferences() Remove all entries holding SoftReferences to gc-evicted objects. | |
V |
get(K key) | |
V |
getAndPut(K key, ValueProvider<? super K, ? extends V> valueProvider) The implementation of `getAndPut` is not atomic | |
V |
put(K key, V value) |
Inherited Methods Summary
Methods inherited from class | Name |
---|---|
class Object | wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Constructor Detail
public LRUCache(int maxCacheSize)
Method Detail
public void cleanUpNullReferences()
Remove all entries holding SoftReferences to gc-evicted objects.
public V get(K key)
@Override public V getAndPut(K key, ValueProvider<? super K, ? extends V> valueProvider)
The implementation of `getAndPut` is not atomic
public V put(K key, V value)
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/2.5.14/html/gapi/org/codehaus/groovy/runtime/memoize/LRUCache.html