Interface DoubleFunction<R>

Type Parameters:
R - the type of the result of the function
All Superinterfaces:
DoubleFunction<R>, Function<Double,​R>, Function<Double,​R>
All Known Subinterfaces:
DoublePredicate, DoubleToIntFunction, DoubleToLongFunction, DoubleUnaryOperator
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 DoubleFunction<R>
extends Function<Double,​R>, DoubleFunction<R>
Represents a function that accepts a double-valued argument and produces a result. This is the double-consuming primitive specialization for Function.

This is a functional interface whose functional method is apply(double).

Since:
1.8
See Also:
Function
  • Field Details

  • Method Details

    • apply

      R apply​(double value)
      Applies this function to the given argument.
      Specified by:
      apply in interface DoubleFunction<R>
      Parameters:
      value - the function argument
      Returns:
      the function result
    • apply

      default R apply​(Double t)
      Applies this function to the given argument.
      Specified by:
      apply in interface Function<Double,​R>
      Specified by:
      apply in interface Function<Double,​R>
      Parameters:
      t - the function argument
      Returns:
      the function result
    • applyPartial

      default Supplier<R> applyPartial​(double t)
      Partially apply a parameter such that a single param function becomes a no-param supplier.
      Parameters:
      t - The parameter to apply.
      Returns:
      A partially-applied function.
    • consume

      default DoubleConsumer consume​(Consumer<R> consumer)
      Consume a function.
      Specified by:
      consume in interface Function<Double,​R>
      Parameters:
      consumer - The consumer to use in consuming.
      Returns:
      A Consumer which passes it's argument to this function and then passes the result into the given consumer.
    • map

      default <S> DoubleFunction<S> map​(Function<? super R,​? extends S> functor)
      Lift a function.
      Specified by:
      map in interface Function<Double,​R>
      Type Parameters:
      S - The return type.
      Parameters:
      functor - The function to use in lifting.
      Returns:
      A function that passes the result of fn through a functor to produce a lifted function.
    • mapToPredicate

      default DoublePredicate mapToPredicate​(Predicate<? super R> functor)
      Lift a function.
      Specified by:
      mapToPredicate in interface Function<Double,​R>
      Parameters:
      functor - The function to use in lifting.
      Returns:
      A function that passes the result of fn through a functor to produce a lifted function.
    • mapToDouble

      default DoubleUnaryOperator mapToDouble​(ToDoubleFunction<? super R> functor)
      Lift a function.
      Specified by:
      mapToDouble in interface Function<Double,​R>
      Parameters:
      functor - The function to use in lifting.
      Returns:
      A function that passes the result of fn through a functor to produce a lifted function.
    • mapToInt

      default DoubleToIntFunction mapToInt​(ToIntFunction<? super R> functor)
      Lift a function.
      Specified by:
      mapToInt in interface Function<Double,​R>
      Parameters:
      functor - The function to use in lifting.
      Returns:
      A function that passes the result of fn through a functor to produce a lifted function.
    • mapToLong

      default DoubleToLongFunction mapToLong​(ToLongFunction<? super R> functor)
      Lift a function.
      Specified by:
      mapToLong in interface Function<Double,​R>
      Parameters:
      functor - The function to use in lifting.
      Returns:
      A function that passes the result of fn through a functor to produce a lifted function.
    • identity

      static DoubleUnaryOperator identity()
      Returns a unary operator that always returns its input argument.
      Returns:
      a unary operator that always returns its input argument