|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.codehaus.groovy.runtime.memoize.Memoize
public abstract class Memoize extends java.lang.Object
Implements memoize for Closures. It is supposed to be used by the Closure class itself to implement the memoize() family of methods.
| Method Summary | |
|---|---|
static Closure
|
buildMemoizeFunction(MemoizeCache cache, Closure closure)
Creates a new closure delegating to the supplied one and memoizing all return values by the arguments. |
static Closure
|
buildSoftReferenceMemoizeFunction(int protectedCacheSize, MemoizeCache cache, Closure closure)
Creates a new closure delegating to the supplied one and memoizing all return values by the arguments. |
| 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() |
| Method Detail |
|---|
public static Closure buildMemoizeFunction(MemoizeCache cache, Closure closure)
cache - A map to hold memoized return valuesclosure - The closure to memoize - The closure's return type
public static Closure buildSoftReferenceMemoizeFunction(int protectedCacheSize, MemoizeCache cache, Closure closure)
protectedCacheSize - The number of hard references to keep in order to prevent some (LRU) memoized return values from evictioncache - A map to hold memoized return valuesclosure - The closure to memoize - The closure's return type
Groovy Documentation