Interface GridClosure3<E1,​E2,​E3,​R>

  • Type Parameters:
    E1 - Type of the first free variable, i.e. the element the closure is called or closed on.
    E2 - Type of the second free variable, i.e. the element the closure is called or closed on.
    E3 - Type of the third free variable, i.e. the element the closure is called or closed on.
    R - Type of the closure's return value.
    All Known Subinterfaces:
    C3<E1,​E2,​E3,​R>
    All Known Implementing Classes:
    CX3, GridClosure3X

    public interface GridClosure3<E1,​E2,​E3,​R>
    Defines generic for-each type of closure. Closure is a first-class function that is defined with (or closed over) its free variables that are bound to the closure scope at execution. Since Java 6 doesn't provide a language construct for first-class function the closures are implemented as abstract classes.

    Type Alias

    To provide for more terse code you can use a typedef C3 class or various factory methods in GridFunc class. Note, however, that since typedefs in Java rely on inheritance you should not use these type aliases in signatures.

    Thread Safety

    Note that this interface does not impose or assume any specific thread-safety by its implementations. Each implementation can elect what type of thread-safety it provides, if any.
    See Also:
    C3, GridFunc
    • Method Detail

      • apply

        R apply​(E1 e1,
                E2 e2,
                E3 e3)
        Closure body.
        Parameters:
        e1 - First bound free variable, i.e. the element the closure is called or closed on.
        e2 - Second bound free variable, i.e. the element the closure is called or closed on.
        e3 - Third bound free variable, i.e. the element the closure is called or closed on.
        Returns:
        Optional return value.