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