Class CachedFunction<TArg,TRes>

  extended by jpaul.Misc.Function<TArg,TRes>
      extended by jpaul.Misc.CachedFunction<TArg,TRes>

public class CachedFunction<TArg,TRes>
extends Function<TArg,TRes>

CachedFunction is a caching wrapper around a (presumably pure) function.

$Id:,v 1.6 2006/03/14 02:29:31 salcianu Exp $
Alexandru Salcianu -

Constructor Summary
CachedFunction(Function<TArg,TRes> func)
          Constructs a caching wrapper around the function func.
Method Summary
 TRes f(TArg arg)
          Takes a TRes and returns a TArg.
Methods inherited from class jpaul.Misc.Function
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public CachedFunction(Function<TArg,TRes> func)
Constructs a caching wrapper around the function func. func should be (observationally) pure (we have no way of checking this, so impure functions are likely to result in hard to find errors).

Method Detail


public TRes f(TArg arg)
Description copied from class: Function
Takes a TRes and returns a TArg. The real function!

Specified by:
f in class Function<TArg,TRes>

Copyright 2005 Alexandru Salcianu -