Click here to Skip to main content
15,885,309 members
Articles / Programming Languages / Java

Functional Java

Rate me:
Please Sign up or sign in to vote.
4.11/5 (6 votes)
7 Dec 2010CPOL8 min read 39.6K   284   14  
Functional programming with functors and object streams in Java.
package swensen.functional;

/**
 * A generic functor for non-void functions with five parameters.
 * @author Stephen Swensen  
 * @param <T1>    the type of the first parameter of call
 * @param <T2>    the type of the second parameter of call
 * @param <T3>    the type of the third parameter of call
 * @param <T4>    the type of the fourth parameter of call
 * @param <T5>    the type of the fifth parameter of call
 */
public interface Action5 <T1,T2,T3,T4,T5> {
    /**
     * Invoke this functor synchronously.
     * @param t1    the first parameter
     * @param t2    the second parameter
     * @param t3    the third parameter
     * @param t4    the fourth parameter
     * @param t5    the fifth parameter
     */
    public void call(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5);
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
I'm developing Unquote, a library for writing unit test assertions as F# quoted expressions: http://code.google.com/p/unquote/

I am working through Project Euler with F#: http://projecteulerfun.blogspot.com/

I participate in Stack Overflow: http://stackoverflow.com/users/236255/stephen-swensen

Comments and Discussions