@FunctionalInterface public interface LToDblFunction<T> extends java.util.function.ToDoubleFunction<T>, MetaFunction, MetaInterface.NonThrowing, OFunction<T,aType.aDouble>, Codomain<aType.aDouble>, Domain1<aType.a<T>>
Non-throwing functional interface (lambda) LToDblFunction for Java 8.
Type: function
Domain (lvl: 1): T a
Co-domain: double
Special case of function that corresponds to expressions like (iterator) -> Iterator::next
| Modifier and Type | Interface and Description |
|---|---|
static class |
LToDblFunction.LToDblFunctionSingle<T> |
MetaInterface.NonThrowing, MetaInterface.Throwing<X>| Modifier and Type | Field and Description |
|---|---|
static String |
DESCRIPTION |
| Modifier and Type | Method and Description |
|---|---|
default double |
applyAsDbl(T a) |
default double |
applyAsDbl(T a,
ExWF<RuntimeException> exF) |
default double |
applyAsDbl(T a,
ExWMF<RuntimeException> exF,
String newMessage,
Object... messageParams) |
default double |
applyAsDblThen(T a,
LToDblFunction<Throwable> handler) |
double |
applyAsDblX(T a)
Implement this, but call applyAsDbl(T a)
|
default double |
applyAsDouble(T a)
Deprecated.
Calling this method via LToDblFunction interface should be discouraged.
|
static <T> double |
call(T a,
LToDblFunction<T> lambda) |
default LDblSupplier |
capture(T a)
Captures arguments but delays the evaluation.
|
default <V2> LToDblFunction<V2> |
cast()
Cast that replace generics.
|
static <V2,T> LToDblFunction<V2> |
cast(LToDblFunction<T> function)
Cast that replace generics.
|
default <V> LToDblFunction<V> |
compose(LFunction<? super V,? extends T> before)
Allows to manipulate the domain of the function.
|
static <V,T> LToDblFunction<V> |
composed(LFunction<? super V,? extends T> before,
LToDblFunction<T> after) |
static <T> LToDblFunction<T> |
constant(double r)
Creates function that always returns the same value.
|
static <T> LToDblFunction<T> |
failSafe(LToDblFunction<T> func,
LToDblFunction<T> failSafe) |
default double |
failSafeApplyAsDbl(T a,
LToDblFunction<T> failSafe) |
static <T> double |
failSafeApplyAsDbl(T a,
LToDblFunction<T> func,
LToDblFunction<T> failSafe) |
default <C0> void |
forEach(IndexedRead<C0,aType.a<T>> ia,
C0 source,
LDblConsumer consumer)
For each element (or tuple) from arguments, calls the function and passes the result to consumer.
|
static <T> void |
fromTill(int min_i,
int max_i,
T a,
LToDblFunction<T> func)
From-To.
|
static <T> void |
fromTo(int min_i,
int max_i,
T a,
LToDblFunction<T> func)
From-To.
|
default String |
functionalInterfaceDescription()
Returns description of the functional interface.
|
default LToDblFunction<T> |
handling(HandlingInstructions<Throwable,RuntimeException> handling) |
default double |
handlingApplyAsDbl(T a,
HandlingInstructions<Throwable,RuntimeException> handling)
Function call that handles exceptions according to the instructions.
|
static <T> double |
handlingApplyAsDbl(T a,
LToDblFunction<T> func,
HandlingInstructions<Throwable,RuntimeException> handling) |
default <C0,I0> void |
iterate(SequentialRead<C0,I0,aType.a<T>> sa,
C0 source,
LDblConsumer consumer)
For each element (or tuple) from arguments, calls the function and passes the result to consumer.
|
default double |
nestingApplyAsDbl(T a)
Function call that handles exceptions by always nesting checked exceptions and propagating the others as is.
|
default double |
nonNullApplyAsDbl(T a)
Just to mirror the method: Ensures the result is not null
|
static <T> double |
produceDouble(T a)
Does nothing (LToDblFunction) Function
|
static <T> LToDblFunction<T> |
recursive(LFunction<LToDblFunction<T>,LToDblFunction<T>> selfLambda) |
static <T> LToDblFunction<T> |
safe()
Safe instance.
|
static <T> LToDblFunction<T> |
safe(LToDblFunction<T> other)
Safe wrapping.
|
static <T> LSupplier<LToDblFunction<T>> |
safeSupplier()
Safe instance supplier.
|
static <T> LSupplier<LToDblFunction<T>> |
safeSupplier(LSupplier<LToDblFunction<T>> supplier)
Safe supplier.
|
default double |
shovingApplyAsDbl(T a)
Function call that handles exceptions by always propagating them as is, even when they are undeclared checked ones.
|
default <V> LFunction<T,V> |
then(LDblFunction<? extends V> after)
Combines two functions together in a order.
|
default LPredicate<T> |
thenToBool(LDblPredicate after)
Combines two functions together in a order.
|
default LToByteFunction<T> |
thenToByte(LDblToByteFunction after)
Combines two functions together in a order.
|
default LToCharFunction<T> |
thenToChar(LDblToCharFunction after)
Combines two functions together in a order.
|
default LToDblFunction<T> |
thenToDbl(LDblUnaryOperator after)
Combines two functions together in a order.
|
default LToFltFunction<T> |
thenToFlt(LDblToFltFunction after)
Combines two functions together in a order.
|
default LToIntFunction<T> |
thenToInt(LDblToIntFunction after)
Combines two functions together in a order.
|
default LToLongFunction<T> |
thenToLong(LDblToLongFunction after)
Combines two functions together in a order.
|
default LToSrtFunction<T> |
thenToSrt(LDblToSrtFunction after)
Combines two functions together in a order.
|
static <T> void |
times(int max_i,
T a,
LToDblFunction<T> func)
From-To.
|
static <T> LToDblFunction<T> |
toDblFunc(LToDblFunction<T> lambda)
Convenient method in case lambda expression is ambiguous for the compiler (that might happen for overloaded methods accepting different interfaces).
|
static <T> LToDblFunction<T> |
toDblFuncThrowing(ExF<Throwable> exF) |
static <T> LToDblFunction<T> |
toDblFuncThrowing(String message,
ExMF<Throwable> exF) |
static <T> double |
tryApplyAsDbl(T a,
LToDblFunction<T> func) |
static <T> double |
tryApplyAsDbl(T a,
LToDblFunction<T> func,
ExWF<RuntimeException> exF) |
static <T> double |
tryApplyAsDbl(T a,
LToDblFunction<T> func,
ExWMF<RuntimeException> exF,
String newMessage,
Object... messageParams) |
static <T> double |
tryApplyAsDblThen(T a,
LToDblFunction<T> func,
LToDblFunction<Throwable> handler) |
default LToDblFunction<T> |
trying(ExWF<RuntimeException> exF) |
default LToDblFunction<T> |
trying(ExWMF<RuntimeException> exF,
String newMessage,
Object... messageParams) |
default LToDblFunction<T> |
tryingThen(LToDblFunction<Throwable> handler) |
default double |
tupleApplyAsDbl(LSingle<T> args) |
default LToDblFunction |
untyped()
Cast that removes generics.
|
static <T> LToDblFunction<T> |
wrap(java.util.function.ToDoubleFunction<T> other)
Wraps JRE instance.
|
isThrowingisFunctionformatTo, isAction, isConsumer, isOperator, isPredicate, isSupplierstatic final String DESCRIPTION
@Deprecated default double applyAsDouble(T a)
Default implementation for JRE method that calls exception nesting method.
applyAsDouble in interface java.util.function.ToDoubleFunction<T>default double applyAsDbl(T a)
double applyAsDblX(T a) throws Throwable
Implement this, but call applyAsDbl(T a)
Throwabledefault double handlingApplyAsDbl(T a, HandlingInstructions<Throwable,RuntimeException> handling)
Function call that handles exceptions according to the instructions.
default LToDblFunction<T> handling(HandlingInstructions<Throwable,RuntimeException> handling)
default double applyAsDbl(T a, @Nonnull ExWMF<RuntimeException> exF, @Nonnull String newMessage, @Nullable Object... messageParams)
default LToDblFunction<T> trying(@Nonnull ExWMF<RuntimeException> exF, @Nonnull String newMessage, @Nullable Object... messageParams)
default double applyAsDbl(T a, @Nonnull ExWF<RuntimeException> exF)
default LToDblFunction<T> trying(@Nonnull ExWF<RuntimeException> exF)
default double applyAsDblThen(T a, @Nonnull LToDblFunction<Throwable> handler)
default LToDblFunction<T> tryingThen(@Nonnull LToDblFunction<Throwable> handler)
default double nestingApplyAsDbl(T a)
Function call that handles exceptions by always nesting checked exceptions and propagating the others as is.
default double shovingApplyAsDbl(T a)
Function call that handles exceptions by always propagating them as is, even when they are undeclared checked ones.
static <T> double handlingApplyAsDbl(T a,
LToDblFunction<T> func,
HandlingInstructions<Throwable,RuntimeException> handling)
static <T> double tryApplyAsDbl(T a,
LToDblFunction<T> func)
static <T> double tryApplyAsDbl(T a,
LToDblFunction<T> func,
@Nonnull
ExWMF<RuntimeException> exF,
@Nonnull
String newMessage,
@Nullable
Object... messageParams)
static <T> double tryApplyAsDbl(T a,
LToDblFunction<T> func,
@Nonnull
ExWF<RuntimeException> exF)
static <T> double tryApplyAsDblThen(T a,
LToDblFunction<T> func,
@Nonnull
LToDblFunction<Throwable> handler)
default double failSafeApplyAsDbl(T a, @Nonnull LToDblFunction<T> failSafe)
static <T> double failSafeApplyAsDbl(T a,
LToDblFunction<T> func,
@Nonnull
LToDblFunction<T> failSafe)
static <T> LToDblFunction<T> failSafe(LToDblFunction<T> func, @Nonnull LToDblFunction<T> failSafe)
default double nonNullApplyAsDbl(T a)
Just to mirror the method: Ensures the result is not null
@Nonnull default String functionalInterfaceDescription()
Returns description of the functional interface.
functionalInterfaceDescription in interface MetaFunctionalInterfacestatic <T> void fromTo(int min_i,
int max_i,
T a,
LToDblFunction<T> func)
From-To. Intended to be used with non-capturing lambda.
static <T> void fromTill(int min_i,
int max_i,
T a,
LToDblFunction<T> func)
From-To. Intended to be used with non-capturing lambda.
static <T> void times(int max_i,
T a,
LToDblFunction<T> func)
From-To. Intended to be used with non-capturing lambda.
default LToDblFunction untyped()
Cast that removes generics.
default <V2> LToDblFunction<V2> cast()
Cast that replace generics.
static <V2,T> LToDblFunction<V2> cast(LToDblFunction<T> function)
Cast that replace generics.
default LDblSupplier capture(T a)
Captures arguments but delays the evaluation.
static <T> LToDblFunction<T> constant(double r)
Creates function that always returns the same value.
@Nonnull static <T> LToDblFunction<T> toDblFunc(@Nonnull LToDblFunction<T> lambda)
Convenient method in case lambda expression is ambiguous for the compiler (that might happen for overloaded methods accepting different interfaces).
@Nonnull static <T> LToDblFunction<T> recursive(@Nonnull LFunction<LToDblFunction<T>,LToDblFunction<T>> selfLambda)
@Nonnull static <T> LToDblFunction<T> toDblFuncThrowing(@Nonnull ExF<Throwable> exF)
@Nonnull static <T> LToDblFunction<T> toDblFuncThrowing(String message, @Nonnull ExMF<Throwable> exF)
static <T> double call(T a,
@Nonnull
LToDblFunction<T> lambda)
@Nonnull static <T> LToDblFunction<T> wrap(java.util.function.ToDoubleFunction<T> other)
Wraps JRE instance.
@Nonnull static <T> LToDblFunction<T> safe()
Safe instance. That always returns the same value (as produceDouble).
@Nonnull static <T> LSupplier<LToDblFunction<T>> safeSupplier()
Safe instance supplier. Returns supplier of safe() instance.
@Nonnull static <T> LToDblFunction<T> safe(@Nullable LToDblFunction<T> other)
Safe wrapping. Either argument function is returned (if it is not null) or safe() instance.
@Nonnull static <T> LSupplier<LToDblFunction<T>> safeSupplier(@Nullable LSupplier<LToDblFunction<T>> supplier)
Safe supplier. Either argument supplier is returned (if it is not null) or supplier of safe() instance.
@Nonnull default <V> LToDblFunction<V> compose(@Nonnull LFunction<? super V,? extends T> before)
Allows to manipulate the domain of the function.
static <V,T> LToDblFunction<V> composed(@Nonnull LFunction<? super V,? extends T> before, LToDblFunction<T> after)
@Nonnull default <V> LFunction<T,V> then(@Nonnull LDblFunction<? extends V> after)
Combines two functions together in a order.
@Nonnull default LToByteFunction<T> thenToByte(@Nonnull LDblToByteFunction after)
Combines two functions together in a order.
@Nonnull default LToSrtFunction<T> thenToSrt(@Nonnull LDblToSrtFunction after)
Combines two functions together in a order.
@Nonnull default LToIntFunction<T> thenToInt(@Nonnull LDblToIntFunction after)
Combines two functions together in a order.
@Nonnull default LToLongFunction<T> thenToLong(@Nonnull LDblToLongFunction after)
Combines two functions together in a order.
@Nonnull default LToFltFunction<T> thenToFlt(@Nonnull LDblToFltFunction after)
Combines two functions together in a order.
@Nonnull default LToDblFunction<T> thenToDbl(@Nonnull LDblUnaryOperator after)
Combines two functions together in a order.
@Nonnull default LToCharFunction<T> thenToChar(@Nonnull LDblToCharFunction after)
Combines two functions together in a order.
@Nonnull default LPredicate<T> thenToBool(@Nonnull LDblPredicate after)
Combines two functions together in a order.
static <T> double produceDouble(T a)
Does nothing (LToDblFunction) Function
default <C0> void forEach(IndexedRead<C0,aType.a<T>> ia, C0 source, LDblConsumer consumer)
For each element (or tuple) from arguments, calls the function and passes the result to consumer. Thread safety, fail-fast, fail-safety of this method is not expected.
default <C0,I0> void iterate(SequentialRead<C0,I0,aType.a<T>> sa, C0 source, LDblConsumer consumer)
For each element (or tuple) from arguments, calls the function and passes the result to consumer. Thread safety, fail-fast, fail-safety of this method depends highly on the arguments.
Copyright © 2019. All rights reserved.