|
Groovy 1.8.1 | |||||||
| 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 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 Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, 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
Copyright © 2003-2010 The Codehaus. All rights reserved.