E - the type of the potential exception of the functionExceptionHandlerSupport<F,F>, PrimitiveReturnExceptionHandlerSupport<DoubleUnaryOperator>@FunctionalInterface public interface DoubleUnaryOperatorWithException<E extends Exception> extends PrimitiveReturnExceptionHandlerSupport<DoubleUnaryOperator>
double-valued operand that may
thrown exception and produces a double-valued result. This is the
primitive type specialization of UnaryOperatorWithException for
double.
double applyAsDouble(double operand)
throws E - The functional method.DoubleUnaryOperatorDoubleUnaryOperatorDoubleUnaryOperatorDoubleUnaryOperator| Modifier and Type | Method | Description |
|---|---|---|
default DoubleUnaryOperatorWithException<E> |
andThen(DoubleUnaryOperatorWithException<? extends E> after) |
Returns a composed operator that first applies this operator to its input,
and then applies the
after operator to the result. |
double |
applyAsDouble(double operand) |
AApplies this operator to the given operand.
|
default DoubleUnaryOperatorWithException<E> |
compose(DoubleUnaryOperatorWithException<? extends E> before) |
Returns a composed operator that first applies the
before operator to
its input, and then applies this operator to the result. |
static <E extends Exception> |
failing(Supplier<E> exceptionBuilder) |
Returns a function that always throw exception.
|
static <E extends Exception> |
identity() |
Returns a unary operator that always returns its input argument.
|
static <E extends Exception> |
ignored(DoubleUnaryOperatorWithException<E> function) |
Converts a
DoubleUnaryOperatorWithException to a lifted
DoubleUnaryOperator returning 0 in case of exception. |
static <E extends Exception> |
lifted(DoubleUnaryOperatorWithException<E> function) |
Converts a
DoubleUnaryOperatorWithException to a lifted
DoubleUnaryOperator using 0 as return value in case of error. |
static <E extends Exception> |
unchecked(DoubleUnaryOperatorWithException<E> function) |
Converts a
DoubleUnaryOperatorException to a
DoubleUnaryOperator that wraps exception to RuntimeException. |
static <E extends Exception> |
unchecked(DoubleUnaryOperatorWithException<E> function,
Function<Exception,RuntimeException> exceptionMapper) |
Converts a
DoubleUnaryOperatorWithException to a
DoubleUnaryOperator that wraps exception to RuntimeException
by using the provided mapping function. |
default DoubleUnaryOperator |
uncheckOrIgnore(boolean uncheck) |
Used internally to implements the ignore or uncheck operation.
|
exceptionMapper, exceptionMapperForhandleException, ignore, lift, uncheckdouble applyAsDouble(double operand)
throws E extends Exception
operand - the operandE - any exceptionE extends ExceptionDoubleUnaryOperator.applyAsDouble(double)default DoubleUnaryOperator uncheckOrIgnore(boolean uncheck)
PrimitiveReturnExceptionHandlerSupportuncheckOrIgnore in interface PrimitiveReturnExceptionHandlerSupport<E extends Exception>uncheck - create unchecked version of the function when true, else ignored
version.default DoubleUnaryOperatorWithException<E> compose(DoubleUnaryOperatorWithException<? extends E> before)
before operator to
its input, and then applies this operator to the result. If evaluation of
either operator throws an exception, it is relayed to the caller of the
composed operator.before - the operator to apply before this operator is appliedbefore operator
and then applies this operatorNullPointerException - if before is nullandThen(DoubleUnaryOperatorWithException)default DoubleUnaryOperatorWithException<E> andThen(DoubleUnaryOperatorWithException<? extends E> after)
after operator to the result. If evaluation of
either operator throws an exception, it is relayed to the caller of the
composed operator.after - the operator to apply after this operator is appliedafter operatorNullPointerException - if after is nullcompose(DoubleUnaryOperatorWithException)static <E extends Exception> DoubleUnaryOperatorWithException<E> identity()
E - the exception that may be thrownstatic <E extends Exception> DoubleUnaryOperatorWithException<E> failing(Supplier<E> exceptionBuilder)
E - the type of the exceptionexceptionBuilder - the supplier to create the exceptionstatic <E extends Exception> DoubleUnaryOperator unchecked(DoubleUnaryOperatorWithException<E> function)
DoubleUnaryOperatorException to a
DoubleUnaryOperator that wraps exception to RuntimeException.E - the type of the potential exceptionfunction - to be uncheckedNullPointerException - if function is nullPrimitiveReturnExceptionHandlerSupport.uncheck(),
unchecked(DoubleUnaryOperatorWithException, Function)static <E extends Exception> DoubleUnaryOperator unchecked(DoubleUnaryOperatorWithException<E> function, Function<Exception,RuntimeException> exceptionMapper)
DoubleUnaryOperatorWithException to a
DoubleUnaryOperator that wraps exception to RuntimeException
by using the provided mapping function.E - the type of the potential exceptionfunction - the be uncheckedexceptionMapper - a function to convert the exception to the runtime exception.NullPointerException - if function or exceptionMapper is nullPrimitiveReturnExceptionHandlerSupport.uncheck(),
unchecked(DoubleUnaryOperatorWithException)static <E extends Exception> DoubleUnaryOperator lifted(DoubleUnaryOperatorWithException<E> function)
DoubleUnaryOperatorWithException to a lifted
DoubleUnaryOperator using 0 as return value in case of error.E - the type of the potential exceptionfunction - to be liftedNullPointerException - if function is nullPrimitiveReturnExceptionHandlerSupport.lift()static <E extends Exception> DoubleUnaryOperator ignored(DoubleUnaryOperatorWithException<E> function)
DoubleUnaryOperatorWithException to a lifted
DoubleUnaryOperator returning 0 in case of exception.E - the type of the potential exceptionfunction - to be liftedNullPointerException - if function is nullPrimitiveReturnExceptionHandlerSupport.ignore()Copyright © 2019. All rights reserved.