org.mymedialite.util
Class Memoizer<A,R>

java.lang.Object
  extended by org.mymedialite.util.Memoizer<A,R>
Type Parameters:
A - the type of the single argument
R - the type of the return value

public class Memoizer<A,R>
extends java.lang.Object

Class to Memoize a function. Provides a version of a function that remembers past function results.


Constructor Summary
Memoizer(java.lang.Object object, java.lang.String methodName, java.lang.Class<A> argType)
          Create a Memoizer
 
Method Summary
 R get(A a)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Memoizer

public Memoizer(java.lang.Object object,
                java.lang.String methodName,
                java.lang.Class<A> argType)
Create a Memoizer

Parameters:
object - the object on which to invoke the method
methodName - the method to call
argType - the single argument type
Throws:
java.lang.NoSuchMethodException
Method Detail

get

public R get(A a)