Interface ExDoubleFunction<R, E extends Exception>

Type Parameters:
R - the type of the result of the function
E - the type of exception thrown
All Superinterfaces:
Wrappable<DoubleFunction<R>>
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 ExDoubleFunction<R, E extends Exception> extends Wrappable<DoubleFunction<R>>
Equivalent of a DoubleFunction that can throw exceptions.
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(double value)
    Applies this function to the given argument.
    Wraps this functional interface, allowing it to be used in contexts where exceptions are not allowed to be thrown directly.
  • Method Details

    • apply

      R apply(double value) throws E
      Applies this function to the given argument.
      Parameters:
      value - the function argument
      Returns:
      the function result
      Throws:
      E - potentially
    • wrap

      default @NonNull DoubleFunction<R> wrap()
      Description copied from interface: Wrappable
      Wraps this functional interface, allowing it to be used in contexts where exceptions are not allowed to be thrown directly.

      If a checked exception is thrown, an ExException, which is a runtime exception, will be thrown instead. This will have the original exception as its cause.

      Specified by:
      wrap in interface Wrappable<R>
      Returns:
      a wrapped instance of type W