[Java] Class LRUCache
- org.codehaus.groovy.runtime.memoize.LRUCache
- All Implemented Interfaces and Traits:
- MemoizeCache
public final class LRUCache extends Object
A cache backed by a Collections.SynchronizedMap
- Authors:
- Vaclav Pech
Constructor Summary
Constructor and description |
---|
LRUCache
(int maxCacheSize) |
Methods Summary
Type Params | Return Type | Name and description |
---|---|---|
void |
cleanUpNullReferences() Replying on the Collections.SynchronizedMap thread-safe iteration implementation the method will remove all entries holding SoftReferences to gc-evicted objects. | |
Object |
get(Object key) | |
Object |
put(Object key, Object 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()
Replying on the Collections.SynchronizedMap thread-safe iteration implementation the method will remove all entries holding SoftReferences to gc-evicted objects.
public Object get(Object key)
public Object put(Object key, Object value)
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/2.4.21/html/gapi/org/codehaus/groovy/runtime/memoize/LRUCache.html