Summary
dishevelled.org functor is a library of typed functor object interfaces. The functor project requires java version 1.5 or later.
Typed functor interfaces exist for Functions, Predicates, and Procedures with varying numbers of parameters. Functions also include a type for the return value. Some examples:
Function<Double> f; f = new Function<Double>() { /** {@inheritDoc} */ public Double evaluate() { ... } }; UnaryPredicate<Double> up; up = new UnaryPredicate<Double>() { /** {@inheritDoc} */ public boolean test(final Double d) { ... } }; BinaryProcedure<Integer, Double> bp; bp = new BinaryProcedure<Integer, Double>() { /** {@inheritDoc} */ public void run(final Integer i, final Double d) { ... } }; TertiaryFunction<Double, Integer, Double, Double> tf; tf = new TertiaryFunction<Double, Integer, Double, Double>() { /** {@inheritDoc} */ public Double evaluate(final Integer i, final Double d0, final Double d1) { ... } }; QuaternaryPredicate<Integer, Double, Double, Float> qp; qp = new QuaternaryPredicate<Integer, Double, Double, Float>() { /** {@inheritDoc} */ public boolean test(final Integer i, final Double d0, final Double d2, final Float f) { ... } }; NaryProcedure<Double> np; np = new NaryProcedure<Double>() { /** {@inheritDoc} */ public void run(final Double... ds) { ... } }
See also
Functor Objects (Wiki)
> http://c2.com/cgi/wiki?FunctorObject
Blocks In Java (Wiki)
> http://c2.com/cgi/wiki?BlocksInJava
jga - Generic Algorithms for Java
> http://jga.sourceforge.net
Apache Jakarta Commons Functor
> http://jakarta.apache.org/commons/sandbox/functor
Colt Project
> http://dsd.lbl.gov/~hoschek/colt
Acknowledgements
- Powered by Apache Maven.
- Project hosting by SourceForge.net.