Interface HexFunction<A,​B,​C,​D,​E,​F,​R>

  • Type Parameters:
    A - The type of the first input-parameter.
    B - The type of the second input-parameter.
    C - The type of the third input-parameter.
    D - The type of the fourth input-parameter.
    E - The type of the fifth input-parameter.
    F - The type of the last input-parameter.
    R - The type of the function-output.
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    public interface HexFunction<A,​B,​C,​D,​E,​F,​R>
    Function-Pointer Input: A, B, C, D, E, F Output: R.

    This is an extension of Java's original functional-interfaces package. This Functional Interface designed here creates a "Hex Function" - a straight-forward extension of interface java.util.function.Function - but instead has an 'apply(...)' method receiving six variable-type parameters instead of just one.

    NOTE: Java's Basic Package java.util.function.*, contains an interface named BiFunction, that extends the basic Function<T> to interface BiFunction<T, U>. The interface that is implemented here follows a similar vein, but extends the number of generic type-parameters to six, instead of two.

    ALSO: Here, the number of return type-parameters (obviously) is still just one - since only one return value is possible, in Java.

    • Method Summary

      @FunctionalInterface (Lambda) Method
      Modifier and Type Method
      R apply​(A a, B b, C c, D d, E e, F f)
      Default Composition & Builder Method(s)
      Modifier and Type Method
      default <V> HexFunction<A,
      andThen​(Function<? super R,​? extends V> after)
    • Method Detail

      • apply

        R apply​(A a,
                B b,
                C c,
                D d,
                E e,
                F f)
        Applies 'this' function to the given arguments.
        a - the first input argument
        b - the second input argument
        c - the third input argument
        d - the fourth input argument
        e - the fifth input argument
        f - the sixth input argument
        The result of the function. Result shall be of type 'R'
      • andThen

        default <V> HexFunction<A,​B,​C,​D,​E,​F,​V> andThen​
                    (java.util.function.Function<? super R,​? extends V> after)
        Returns a composed function that first applies 'this' function to its input, and then applies the 'after' function to the result. If evaluation of either function throws an exception, it is relayed to the caller of the composed function.
        after - The function to apply after 'this' function is applied. This must be a simple, or single-argument function that has a variable-type parameter 'X' - or rather, the same-type as the output-type of 'this' (which, again, is 'X' - and pleaselook at the top of this page to see that 'X' is, indeed, the output type of 'this' apply(...) method).

        NOTE: The composed function that is returned will, itself, have an apply(...) method with variable-parameter return type 'V'.
        a composed 'HexFunction', that first applies 'this' function, and then applies the 'after' function.
        java.lang.NullPointerException - This is thrown if 'after' is null.
        Exact Method Body:
         if (after == null)
             throw new NullPointerException("parameter 'after' has been passed null.");
         return (A a, B b, C c, D d, E e, F f) -> after.apply(this.apply(a, b, c, d, e, f));