Class LRUCache
- java.lang.Object
-
- org.codehaus.groovy.runtime.memoize.LRUCache
-
- All Implemented Interfaces:
MemoizeCache<Object,Object>
public final class LRUCache extends Object implements MemoizeCache<Object,Object>
A cache backed by a Collections.SynchronizedMap- Author:
- Vaclav Pech
-
-
Constructor Summary
Constructors Constructor Description LRUCache(int maxCacheSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
-
-
Method Detail
-
put
public Object put(Object key, Object value)
- Specified by:
put
in interfaceMemoizeCache<Object,Object>
-
cleanUpNullReferences
public void cleanUpNullReferences()
Replying on the Collections.SynchronizedMap thread-safe iteration implementation the method will remove all entries holding SoftReferences to gc-evicted objects.- Specified by:
cleanUpNullReferences
in interfaceMemoizeCache<Object,Object>
-
-