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.

    @FunctionalInterface
    public interface DoubleTFunction<T,​R>
    DoubleTFunction Documentation.

    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 one of generic parameter-type 'T'




    • Method Detail

      • apply

        R apply​(double d,
                T t)
        Applies this function to the given arguments.
        Parameters:
        d - The double (first) argument to the function.
        t - The (second) argument to the function.
        Returns:
        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.
        Parameters:
        after - The function to apply, after this function is applied.
        Returns:
        a composed function that first applies 'this' function and then applies the 'after' function
        Throws:
        java.lang.NullPointerException - if null is passed to parameter 'after'.
        Code:
        Exact Method Body:
        1
        2
        3
        4
         if (after == null) throw new NullPointerException
             ("null has been passed to parameter 'after'");
        
         return (double d, T t) -> after.apply(this.apply(d, t));