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