public class Memoizer<A,V> extends java.lang.Object implements LowLevelProcessor<A,V>
Constructor and Description |
---|
Memoizer() |
Modifier and Type | Method and Description |
---|---|
V |
compute(ComputableTask<A,V> c,
A taskArg)
Waits if necessary for the computation to complete, and then
retrieves its result.
|
void |
forget(ComputableTask<A,V> task,
A key)
Forgets result of the specified task.
|
void |
forgetAll()
Forgets all cached results.
|
public V compute(ComputableTask<A,V> c, A taskArg) throws java.lang.InterruptedException
LowLevelProcessor
compute
in interface LowLevelProcessor<A,V>
taskArg
- argument for computationjava.lang.InterruptedException
- if the current thread was interrupted
while waitingpublic void forget(ComputableTask<A,V> task, A key)
task
- computable task, forming part of result keykey
- argument of computationpublic void forgetAll()
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference