Interface DoubleTFunction<T,​R>

  • Type Parameters:
    T - The type of the second 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 DoubleTFunction<T,​R>
    Function-Pointer Input: double, T Output: R.

    A Functional Interface, that's similar to java.util.function.BiFunction, but having an apply(...) method that accepts a parameter of primitive-type 'double' and a parameter of Parameterized-Type 'T'

    • Method Summary

      @FunctionalInterface: (Lambda) Method
      Modifier and Type Method
      R apply​(double d, T t)
      Default Composition & Builder Method(s)
      Modifier and Type Method
      default <V> DoubleTFunction<T,​V> andThen​(Function<? super R,​? extends V> after)
    • Method Detail

      • apply

        🡇     🗕  🗗  🗖
        R apply​(double d,
                T t)
        Applies this function to the given arguments.

        FunctionalInterface Target-Method:
        This method corresponds to the @FunctionalInterface Annotation's method requirement. It is the only non-default, non-static method in this interface, and may be the target of a Lambda-Expression or '::' (double-colon) Function-Pointer.
        d - The double (first) argument to the function.
        t - The (second) argument to the function.
        The function result. Result shall be of type 'R'
      • andThen

        🡅     🗕  🗗  🗖
        default <V> DoubleTFunction<T,​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.
        Type Parameters:
        V - the output-type of the 'after' function, and also of the (returned) 'composed' function.
        after - The function to apply, after this function is applied.
        a composed function that first applies 'this' function and then applies the 'after' function
        java.lang.NullPointerException - if null is passed to parameter 'after'.
        Exact Method Body:
         if (after == null) throw new NullPointerException
             ("null has been passed to parameter 'after'");
         return (double d, T t) -> after.apply(this.apply(d, t));