@FunctionalInterface public interface ThrowingDoubleBinaryOperator extends DoubleBinaryOperator
double-valued operands, producing a double-valued result, and possibly throwing an exception.| Modifier and Type | Method and Description |
|---|---|
default double |
applyAsDouble(double former,
double latter)
Applies this operator to the given arguments.
|
double |
applyAsDoubleThrowing(double former,
double latter)
Applies this operator to the given arguments.
|
default DoubleBinaryOperator |
fallbackTo(DoubleBinaryOperator fallback)
Returns a
DoubleBinaryOperator applying the given operator to the arguments if this operator throws an exception. |
default DoubleBinaryOperator |
fallbackTo(DoubleBinaryOperator fallback,
Consumer<Exception> exceptionConsumer)
Returns a
DoubleBinaryOperator applying the given operator to the arguments if this operator throws an exception. |
default DoubleBinaryOperator |
orReturn(double value)
Returns a
DoubleBinaryOperator returning the given value if this operator throws an exception. |
default DoubleBinaryOperator |
orReturn(double value,
Consumer<Exception> exceptionConsumer)
Returns a
DoubleBinaryOperator returning the given value if this operator throws an exception. |
default ThrowingDoubleBinaryOperator |
orThrow(Class<? extends RuntimeException> exceptionClass)
Returns a
ThrowingDoubleBinaryOperator throwing an exception of the given type if this operator throws an exception. |
default ThrowingDoubleBinaryOperator |
orThrow(Class<? extends RuntimeException> exceptionClass,
String message)
Returns a
ThrowingDoubleBinaryOperator throwing an exception of the given type if this operator throws an exception. |
default ThrowingDoubleBinaryOperator |
orTryWith(ThrowingDoubleBinaryOperator other)
Returns a
ThrowingDoubleBinaryOperator applying the given operator to the arguments if this operator throws an exception. |
default ThrowingDoubleBinaryOperator |
orTryWith(ThrowingDoubleBinaryOperator other,
Consumer<Exception> exceptionConsumer)
Returns a
ThrowingDoubleBinaryOperator applying the given operator to the arguments if this operator throws an exception. |
default double applyAsDouble(double former,
double latter)
UncheckedException.applyAsDouble in interface DoubleBinaryOperatordouble applyAsDoubleThrowing(double former,
double latter)
throws Exception
Exceptiondefault DoubleBinaryOperator fallbackTo(DoubleBinaryOperator fallback)
DoubleBinaryOperator applying the given operator to the arguments if this operator throws an exception.IllegalArgumentException - if fallback is nulldefault DoubleBinaryOperator fallbackTo(DoubleBinaryOperator fallback, Consumer<Exception> exceptionConsumer)
DoubleBinaryOperator applying the given operator to the arguments if this operator throws an exception.IllegalArgumentException - if fallback is nulldefault DoubleBinaryOperator orReturn(double value)
DoubleBinaryOperator returning the given value if this operator throws an exception.default DoubleBinaryOperator orReturn(double value, Consumer<Exception> exceptionConsumer)
DoubleBinaryOperator returning the given value if this operator throws an exception.default ThrowingDoubleBinaryOperator orThrow(Class<? extends RuntimeException> exceptionClass)
ThrowingDoubleBinaryOperator throwing an exception of the given type if this operator throws an exception.
The original exception thrown by this operator is the cause of the thrown exception.
The exception class must have a constructor accepting a single Throwable as an argument.
IllegalArgumentException - if exceptionClass is nulldefault ThrowingDoubleBinaryOperator orThrow(Class<? extends RuntimeException> exceptionClass, String message)
ThrowingDoubleBinaryOperator throwing an exception of the given type if this operator throws an exception.
The original exception thrown by this operator is the cause of the thrown exception.
The exception class must have a constructor accepting String and Throwable as arguments.
IllegalArgumentException - if exceptionClass is nulldefault ThrowingDoubleBinaryOperator orTryWith(ThrowingDoubleBinaryOperator other)
ThrowingDoubleBinaryOperator applying the given operator to the arguments if this operator throws an exception.IllegalArgumentException - if other is nulldefault ThrowingDoubleBinaryOperator orTryWith(ThrowingDoubleBinaryOperator other, Consumer<Exception> exceptionConsumer)
ThrowingDoubleBinaryOperator applying the given operator to the arguments if this operator throws an exception.IllegalArgumentException - if other is null