Interface CharTFunction<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 CharTFunction<T,​R>
    Function-Pointer Input: chat, 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 'char' and one of generic parameter-type 'T'

    • Method Summary

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

      • apply

        R apply​(char c,
                T t)
        Applies this function to the given arguments.
        c - The character (first) argument to the function.
        t - The (second) argument to the function.
        The function result. Result shall be of type 'R'
      • andThen

        default <V> CharTFunction<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 (char c, T t) -> after.apply(this.apply(c, t));