jpaul.Misc
Class Function<TArg,TRes>

java.lang.Object
  extended by jpaul.Misc.Function<TArg,TRes>
Direct Known Subclasses:
CachedFunction, IdFunction

public abstract class Function<TArg,TRes>
extends java.lang.Object

Function is a wrapper around a function that takes a TArg and returns a TRes.

Version:
$Id: Function.java,v 1.5 2006/03/14 02:29:31 salcianu Exp $
Author:
Alexandru Salcianu - salcianu@alum.mit.edu

Constructor Summary
Function()
           
 
Method Summary
static
<T1,T2,T3> Function<T1,T3>
comp(Function<T2,T3> func1, Function<T1,T2> func2)
          Computes the composition of two functions.
abstract  TRes f(TArg arg)
          Takes a TRes and returns a TArg.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Function

public Function()
Method Detail

f

public abstract TRes f(TArg arg)
Takes a TRes and returns a TArg. The real function!


comp

public static <T1,T2,T3> Function<T1,T3> comp(Function<T2,T3> func1,
                                              Function<T1,T2> func2)
Computes the composition of two functions.



Copyright 2005 Alexandru Salcianu - salcianu@alum.mit.edu