@com.github.javaparser.ast.expr.MarkerAnnotationExprThreadSafe public final class LRUCache extends Object
A cache backed by a ConcurrentLinkedHashMap
Constructor and description |
---|
LRUCache
(int maxCacheSize) |
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) Try to get the value from cache. |
|
V |
put(K key, V value) |
Remove all entries holding SoftReferences to gc-evicted objects.
Try to get the value from cache. If not found, create the value by MemoizeCache.ValueProvider and put it into the cache, at last return the value. The operation is completed atomically.
valueProvider
- provide the value if the associated value not foundCopyright © 2003-2020 The Apache Software Foundation. All rights reserved.