Groovy Documentation

org.codehaus.groovy.runtime.memoize
[Java] Class LRUCache

java.lang.Object
  org.codehaus.groovy.runtime.memoize.LRUCache
All Implemented Interfaces:
MemoizeCache

public final class LRUCache
extends java.lang.Object

A cache backed by a Collections.SynchronizedMap

Authors:
Vaclav Pech


Constructor Summary
LRUCache(int maxCacheSize)

 
Method Summary
void cleanUpNullReferences()

Replying on the Collections.SynchronizedMap thread-safe iteration implementation the method will remove all entries holding SoftReferences to gc-evicted objects.

java.lang.Object get(java.lang.Object key)

java.lang.Object put(java.lang.Object key, java.lang.Object value)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Constructor Detail

LRUCache

public LRUCache(int maxCacheSize)


 
Method Detail

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.


get

public java.lang.Object get(java.lang.Object key)


put

public java.lang.Object put(java.lang.Object key, java.lang.Object value)


 

Groovy Documentation