@FunctionalInterface public interface LToFltFunction<T> extends MetaFunction, MetaInterface.NonThrowing, OFunction<T,aType.aFloat>, Codomain<aType.aFloat>, Domain1<aType.a<T>>
Non-throwing functional interface (lambda) LToFltFunction for Java 8.
Type: function
Domain (lvl: 1): T a
Co-domain: float
Special case of function that corresponds to expressions like (iterator) -> Iterator::next
| Modifier and Type | Interface and Description |
|---|---|
static class |
LToFltFunction.LToFltFunctionSingle<T> |
MetaInterface.NonThrowing, MetaInterface.Throwing<X>| Modifier and Type | Field and Description |
|---|---|
static String |
DESCRIPTION |
| Modifier and Type | Method and Description |
|---|---|
default float |
applyAsFlt(T a) |
default float |
applyAsFlt(T a,
ExWF<RuntimeException> exF) |
default float |
applyAsFlt(T a,
ExWMF<RuntimeException> exF,
String newMessage,
Object... messageParams) |
default float |
applyAsFltThen(T a,
LToFltFunction<Throwable> handler) |
float |
applyAsFltX(T a)
Implement this, but call applyAsFlt(T a)
|
static <T> float |
call(T a,
LToFltFunction<T> lambda) |
default LFltSupplier |
capture(T a)
Captures arguments but delays the evaluation.
|
default <V2> LToFltFunction<V2> |
cast()
Cast that replace generics.
|
static <V2,T> LToFltFunction<V2> |
cast(LToFltFunction<T> function)
Cast that replace generics.
|
default <V> LToFltFunction<V> |
compose(LFunction<? super V,? extends T> before)
Allows to manipulate the domain of the function.
|
static <V,T> LToFltFunction<V> |
composed(LFunction<? super V,? extends T> before,
LToFltFunction<T> after) |
static <T> LToFltFunction<T> |
constant(float r)
Creates function that always returns the same value.
|
static <T> LToFltFunction<T> |
failSafe(LToFltFunction<T> func,
LToFltFunction<T> failSafe) |
default float |
failSafeApplyAsFlt(T a,
LToFltFunction<T> failSafe) |
static <T> float |
failSafeApplyAsFlt(T a,
LToFltFunction<T> func,
LToFltFunction<T> failSafe) |
default <C0> void |
forEach(IndexedRead<C0,aType.a<T>> ia,
C0 source,
LFltConsumer 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,
LToFltFunction<T> func)
From-To.
|
static <T> void |
fromTo(int min_i,
int max_i,
T a,
LToFltFunction<T> func)
From-To.
|
default String |
functionalInterfaceDescription()
Returns description of the functional interface.
|
default LToFltFunction<T> |
handling(HandlingInstructions<Throwable,RuntimeException> handling) |
default float |
handlingApplyAsFlt(T a,
HandlingInstructions<Throwable,RuntimeException> handling)
Function call that handles exceptions according to the instructions.
|
static <T> float |
handlingApplyAsFlt(T a,
LToFltFunction<T> func,
HandlingInstructions<Throwable,RuntimeException> handling) |
default <C0,I0> void |
iterate(SequentialRead<C0,I0,aType.a<T>> sa,
C0 source,
LFltConsumer consumer)
For each element (or tuple) from arguments, calls the function and passes the result to consumer.
|
default float |
nestingApplyAsFlt(T a)
Function call that handles exceptions by always nesting checked exceptions and propagating the others as is.
|
default float |
nonNullApplyAsFlt(T a)
Just to mirror the method: Ensures the result is not null
|
static <T> float |
produceFloat(T a)
Does nothing (LToFltFunction) Function
|
static <T> LToFltFunction<T> |
recursive(LFunction<LToFltFunction<T>,LToFltFunction<T>> selfLambda) |
static <T> LToFltFunction<T> |
safe()
Safe instance.
|
static <T> LToFltFunction<T> |
safe(LToFltFunction<T> other)
Safe wrapping.
|
static <T> LSupplier<LToFltFunction<T>> |
safeSupplier()
Safe instance supplier.
|
static <T> LSupplier<LToFltFunction<T>> |
safeSupplier(LSupplier<LToFltFunction<T>> supplier)
Safe supplier.
|
default float |
shovingApplyAsFlt(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(LFltFunction<? extends V> after)
Combines two functions together in a order.
|
default LPredicate<T> |
thenToBool(LFltPredicate after)
Combines two functions together in a order.
|
default LToByteFunction<T> |
thenToByte(LFltToByteFunction after)
Combines two functions together in a order.
|
default LToCharFunction<T> |
thenToChar(LFltToCharFunction after)
Combines two functions together in a order.
|
default LToDblFunction<T> |
thenToDbl(LFltToDblFunction after)
Combines two functions together in a order.
|
default LToFltFunction<T> |
thenToFlt(LFltUnaryOperator after)
Combines two functions together in a order.
|
default LToIntFunction<T> |
thenToInt(LFltToIntFunction after)
Combines two functions together in a order.
|
default LToLongFunction<T> |
thenToLong(LFltToLongFunction after)
Combines two functions together in a order.
|
default LToSrtFunction<T> |
thenToSrt(LFltToSrtFunction after)
Combines two functions together in a order.
|
static <T> void |
times(int max_i,
T a,
LToFltFunction<T> func)
From-To.
|
static <T> LToFltFunction<T> |
toFltFunc(LToFltFunction<T> lambda)
Convenient method in case lambda expression is ambiguous for the compiler (that might happen for overloaded methods accepting different interfaces).
|
static <T> LToFltFunction<T> |
toFltFuncThrowing(ExF<Throwable> exF) |
static <T> LToFltFunction<T> |
toFltFuncThrowing(String message,
ExMF<Throwable> exF) |
static <T> float |
tryApplyAsFlt(T a,
LToFltFunction<T> func) |
static <T> float |
tryApplyAsFlt(T a,
LToFltFunction<T> func,
ExWF<RuntimeException> exF) |
static <T> float |
tryApplyAsFlt(T a,
LToFltFunction<T> func,
ExWMF<RuntimeException> exF,
String newMessage,
Object... messageParams) |
static <T> float |
tryApplyAsFltThen(T a,
LToFltFunction<T> func,
LToFltFunction<Throwable> handler) |
default LToFltFunction<T> |
trying(ExWF<RuntimeException> exF) |
default LToFltFunction<T> |
trying(ExWMF<RuntimeException> exF,
String newMessage,
Object... messageParams) |
default LToFltFunction<T> |
tryingThen(LToFltFunction<Throwable> handler) |
default float |
tupleApplyAsFlt(LSingle<T> args) |
default LToFltFunction |
untyped()
Cast that removes generics.
|
isThrowingisFunctionformatTo, isAction, isConsumer, isOperator, isPredicate, isSupplierstatic final String DESCRIPTION
default float applyAsFlt(T a)
float applyAsFltX(T a) throws Throwable
Implement this, but call applyAsFlt(T a)
Throwabledefault float handlingApplyAsFlt(T a, HandlingInstructions<Throwable,RuntimeException> handling)
Function call that handles exceptions according to the instructions.
default LToFltFunction<T> handling(HandlingInstructions<Throwable,RuntimeException> handling)
default float applyAsFlt(T a, @Nonnull ExWMF<RuntimeException> exF, @Nonnull String newMessage, @Nullable Object... messageParams)
default LToFltFunction<T> trying(@Nonnull ExWMF<RuntimeException> exF, @Nonnull String newMessage, @Nullable Object... messageParams)
default float applyAsFlt(T a, @Nonnull ExWF<RuntimeException> exF)
default LToFltFunction<T> trying(@Nonnull ExWF<RuntimeException> exF)
default float applyAsFltThen(T a, @Nonnull LToFltFunction<Throwable> handler)
default LToFltFunction<T> tryingThen(@Nonnull LToFltFunction<Throwable> handler)
default float nestingApplyAsFlt(T a)
Function call that handles exceptions by always nesting checked exceptions and propagating the others as is.
default float shovingApplyAsFlt(T a)
Function call that handles exceptions by always propagating them as is, even when they are undeclared checked ones.
static <T> float handlingApplyAsFlt(T a,
LToFltFunction<T> func,
HandlingInstructions<Throwable,RuntimeException> handling)
static <T> float tryApplyAsFlt(T a,
LToFltFunction<T> func)
static <T> float tryApplyAsFlt(T a,
LToFltFunction<T> func,
@Nonnull
ExWMF<RuntimeException> exF,
@Nonnull
String newMessage,
@Nullable
Object... messageParams)
static <T> float tryApplyAsFlt(T a,
LToFltFunction<T> func,
@Nonnull
ExWF<RuntimeException> exF)
static <T> float tryApplyAsFltThen(T a,
LToFltFunction<T> func,
@Nonnull
LToFltFunction<Throwable> handler)
default float failSafeApplyAsFlt(T a, @Nonnull LToFltFunction<T> failSafe)
static <T> float failSafeApplyAsFlt(T a,
LToFltFunction<T> func,
@Nonnull
LToFltFunction<T> failSafe)
static <T> LToFltFunction<T> failSafe(LToFltFunction<T> func, @Nonnull LToFltFunction<T> failSafe)
default float nonNullApplyAsFlt(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,
LToFltFunction<T> func)
From-To. Intended to be used with non-capturing lambda.
static <T> void fromTill(int min_i,
int max_i,
T a,
LToFltFunction<T> func)
From-To. Intended to be used with non-capturing lambda.
static <T> void times(int max_i,
T a,
LToFltFunction<T> func)
From-To. Intended to be used with non-capturing lambda.
default LToFltFunction untyped()
Cast that removes generics.
default <V2> LToFltFunction<V2> cast()
Cast that replace generics.
static <V2,T> LToFltFunction<V2> cast(LToFltFunction<T> function)
Cast that replace generics.
default LFltSupplier capture(T a)
Captures arguments but delays the evaluation.
static <T> LToFltFunction<T> constant(float r)
Creates function that always returns the same value.
@Nonnull static <T> LToFltFunction<T> toFltFunc(@Nonnull LToFltFunction<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> LToFltFunction<T> recursive(@Nonnull LFunction<LToFltFunction<T>,LToFltFunction<T>> selfLambda)
@Nonnull static <T> LToFltFunction<T> toFltFuncThrowing(@Nonnull ExF<Throwable> exF)
@Nonnull static <T> LToFltFunction<T> toFltFuncThrowing(String message, @Nonnull ExMF<Throwable> exF)
static <T> float call(T a,
@Nonnull
LToFltFunction<T> lambda)
@Nonnull static <T> LToFltFunction<T> safe()
Safe instance. That always returns the same value (as produceFloat).
@Nonnull static <T> LSupplier<LToFltFunction<T>> safeSupplier()
Safe instance supplier. Returns supplier of safe() instance.
@Nonnull static <T> LToFltFunction<T> safe(@Nullable LToFltFunction<T> other)
Safe wrapping. Either argument function is returned (if it is not null) or safe() instance.
@Nonnull static <T> LSupplier<LToFltFunction<T>> safeSupplier(@Nullable LSupplier<LToFltFunction<T>> supplier)
Safe supplier. Either argument supplier is returned (if it is not null) or supplier of safe() instance.
@Nonnull default <V> LToFltFunction<V> compose(@Nonnull LFunction<? super V,? extends T> before)
Allows to manipulate the domain of the function.
static <V,T> LToFltFunction<V> composed(@Nonnull LFunction<? super V,? extends T> before, LToFltFunction<T> after)
@Nonnull default <V> LFunction<T,V> then(@Nonnull LFltFunction<? extends V> after)
Combines two functions together in a order.
@Nonnull default LToByteFunction<T> thenToByte(@Nonnull LFltToByteFunction after)
Combines two functions together in a order.
@Nonnull default LToSrtFunction<T> thenToSrt(@Nonnull LFltToSrtFunction after)
Combines two functions together in a order.
@Nonnull default LToIntFunction<T> thenToInt(@Nonnull LFltToIntFunction after)
Combines two functions together in a order.
@Nonnull default LToLongFunction<T> thenToLong(@Nonnull LFltToLongFunction after)
Combines two functions together in a order.
@Nonnull default LToFltFunction<T> thenToFlt(@Nonnull LFltUnaryOperator after)
Combines two functions together in a order.
@Nonnull default LToDblFunction<T> thenToDbl(@Nonnull LFltToDblFunction after)
Combines two functions together in a order.
@Nonnull default LToCharFunction<T> thenToChar(@Nonnull LFltToCharFunction after)
Combines two functions together in a order.
@Nonnull default LPredicate<T> thenToBool(@Nonnull LFltPredicate after)
Combines two functions together in a order.
static <T> float produceFloat(T a)
Does nothing (LToFltFunction) Function
default <C0> void forEach(IndexedRead<C0,aType.a<T>> ia, C0 source, LFltConsumer 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, LFltConsumer 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.