@FunctionalInterface public interface LLogicalOperator extends MetaInterface.NonThrowing, MetaLogicalOperator, Codomain<aType.aBool>, Domain1<aType.aBool>
Non-throwing functional interface (lambda) LLogicalOperator for Java 8.
Type: operator
Domain (lvl: 1): boolean a
Co-domain: boolean
| Modifier and Type | Interface and Description |
|---|---|
static class |
LLogicalOperator.LLogicalOperatorSingle |
MetaInterface.NonThrowing, MetaInterface.Throwing<X>| Modifier and Type | Field and Description |
|---|---|
static String |
DESCRIPTION |
| Modifier and Type | Method and Description |
|---|---|
default LLogicalOperator |
and(LLogicalOperator other)
Returns a predicate that represents the logical AND of evaluation of this predicate and the argument one.
|
default boolean |
apply(boolean a) |
default boolean |
apply(boolean a,
ExWF<RuntimeException> exF) |
default boolean |
apply(boolean a,
ExWMF<RuntimeException> exF,
String newMessage,
Object... messageParams) |
default boolean |
applyThen(boolean a,
LPredicate<Throwable> handler) |
boolean |
applyX(boolean a)
Implement this, but call apply(boolean a)
|
static boolean |
call(boolean a,
LLogicalOperator lambda) |
default LBoolSupplier |
capture(boolean a)
Captures arguments but delays the evaluation.
|
default LLogicalOperator |
compose(LLogicalOperator before)
Allows to manipulate the domain of the function.
|
static LLogicalOperator |
composed(LLogicalOperator before,
LLogicalOperator after) |
static <V> LPredicate<V> |
composed(LPredicate<? super V> before,
LLogicalOperator after) |
static LLogicalOperator |
constant(boolean r)
Creates function that always returns the same value.
|
default boolean |
doIf(boolean a,
LAction action) |
default boolean |
doIf(boolean a,
LBoolConsumer consumer) |
static boolean |
doIf(boolean a,
LLogicalOperator predicate,
LAction action) |
static boolean |
doIf(boolean a,
LLogicalOperator predicate,
LBoolConsumer consumer) |
default <V> boolean |
doIf(V a1,
boolean a2,
LObjBoolConsumer<V> consumer) |
default <V> boolean |
doIf(V a1,
int a2,
boolean a3,
LTieBoolConsumer<? super V> consumer) |
default <V> int |
doIf(V a1,
int a2,
boolean a3,
LTieBoolFunction<? super V> consumer) |
default boolean |
doTest(boolean a)
For convenience, boolean operator is also special case of predicate.
|
static LLogicalOperator |
failSafe(LLogicalOperator func,
LLogicalOperator failSafe) |
default boolean |
failSafeApply(boolean a,
LLogicalOperator failSafe) |
static boolean |
failSafeApply(boolean a,
LLogicalOperator func,
LLogicalOperator failSafe) |
default <C0> void |
forEach(IndexedRead<C0,aType.aBool> ia,
C0 source,
LBoolConsumer consumer)
For each element (or tuple) from arguments, calls the function and passes the result to consumer.
|
static void |
fromTill(int min_i,
int max_i,
boolean a,
LLogicalOperator func)
From-To.
|
static void |
fromTo(int min_i,
int max_i,
boolean a,
LLogicalOperator func)
From-To.
|
default String |
functionalInterfaceDescription()
Returns description of the functional interface.
|
default LLogicalOperator |
handling(HandlingInstructions<Throwable,RuntimeException> handling) |
default boolean |
handlingApply(boolean a,
HandlingInstructions<Throwable,RuntimeException> handling)
Function call that handles exceptions according to the instructions.
|
static boolean |
handlingApply(boolean a,
LLogicalOperator func,
HandlingInstructions<Throwable,RuntimeException> handling) |
static LLogicalOperator |
identity()
Returns a function that always returns its input argument.
|
static LLogicalOperator |
isEqual(boolean target)
Creates predicate that evaluates if an object is equal with the argument one.
|
default <C0,I0> void |
iterate(SequentialRead<C0,I0,aType.aBool> sa,
C0 source,
LBoolConsumer consumer)
For each element (or tuple) from arguments, calls the function and passes the result to consumer.
|
static LLogicalOperator |
logicalOp(LLogicalOperator lambda)
Convenient method in case lambda expression is ambiguous for the compiler (that might happen for overloaded methods accepting different interfaces).
|
default <V> LPredicate<V> |
logicalOpCompose(LPredicate<? super V> before)
Allows to manipulate the domain of the function.
|
static LLogicalOperator |
logicalOpThrowing(ExF<Throwable> exF) |
static LLogicalOperator |
logicalOpThrowing(String message,
ExMF<Throwable> exF) |
default LLogicalOperator |
negate()
Returns a predicate that represents the logical negation of this predicate.
|
default boolean |
nestingApply(boolean a)
Function call that handles exceptions by always nesting checked exceptions and propagating the others as is.
|
default boolean |
nonNullApply(boolean a)
Just to mirror the method: Ensures the result is not null
|
default LLogicalOperator |
or(LLogicalOperator other)
Returns a predicate that represents the logical OR of evaluation of this predicate and the argument one.
|
static boolean |
produceBoolean(boolean a)
Does nothing (LLogicalOperator) Operator
|
static LLogicalOperator |
recursive(LFunction<LLogicalOperator,LLogicalOperator> selfLambda) |
static LLogicalOperator |
safe()
Safe instance.
|
static LLogicalOperator |
safe(LLogicalOperator other)
Safe wrapping.
|
static LSupplier<LLogicalOperator> |
safeSupplier()
Safe instance supplier.
|
static LSupplier<LLogicalOperator> |
safeSupplier(LSupplier<LLogicalOperator> supplier)
Safe supplier.
|
default boolean |
shovingApply(boolean a)
Function call that handles exceptions by always propagating them as is, even when they are undeclared checked ones.
|
default <V> LBoolFunction<V> |
then(LBoolFunction<? extends V> after)
Combines two functions together in a order.
|
default LLogicalOperator |
thenToBool(LLogicalOperator after)
Combines two functions together in a order.
|
default LBoolToByteFunction |
thenToByte(LBoolToByteFunction after)
Combines two functions together in a order.
|
default LBoolToCharFunction |
thenToChar(LBoolToCharFunction after)
Combines two functions together in a order.
|
default LBoolToDblFunction |
thenToDbl(LBoolToDblFunction after)
Combines two functions together in a order.
|
default LBoolToFltFunction |
thenToFlt(LBoolToFltFunction after)
Combines two functions together in a order.
|
default LBoolToIntFunction |
thenToInt(LBoolToIntFunction after)
Combines two functions together in a order.
|
default LBoolToLongFunction |
thenToLong(LBoolToLongFunction after)
Combines two functions together in a order.
|
default LBoolToSrtFunction |
thenToSrt(LBoolToSrtFunction after)
Combines two functions together in a order.
|
static void |
throwIf(boolean a,
LLogicalOperator pred,
ExMF<RuntimeException> factory,
String newMessage,
Object... messageParams) |
static void |
throwIfNot(boolean a,
LLogicalOperator pred,
ExMF<RuntimeException> factory,
String newMessage,
Object... messageParams) |
static void |
times(int max_i,
boolean a,
LLogicalOperator func)
From-To.
|
static boolean |
tryApply(boolean a,
LLogicalOperator func) |
static boolean |
tryApply(boolean a,
LLogicalOperator func,
ExWF<RuntimeException> exF) |
static boolean |
tryApply(boolean a,
LLogicalOperator func,
ExWMF<RuntimeException> exF,
String newMessage,
Object... messageParams) |
static boolean |
tryApplyThen(boolean a,
LLogicalOperator func,
LPredicate<Throwable> handler) |
default LLogicalOperator |
trying(ExWF<RuntimeException> exF) |
default LLogicalOperator |
trying(ExWMF<RuntimeException> exF,
String newMessage,
Object... messageParams) |
default LLogicalOperator |
tryingThen(LPredicate<Throwable> handler) |
default boolean |
tupleApply(LBoolSingle args) |
default LLogicalOperator |
xor(LLogicalOperator other)
Returns a predicate that represents the logical XOR of evaluation of this predicate and the argument one.
|
isThrowingisOperatorisPredicateisFunctionformatTo, isAction, isConsumer, isSupplierstatic final String DESCRIPTION
default boolean apply(boolean a)
boolean applyX(boolean a)
throws Throwable
Implement this, but call apply(boolean a)
Throwabledefault boolean tupleApply(LBoolSingle args)
default boolean handlingApply(boolean a,
HandlingInstructions<Throwable,RuntimeException> handling)
Function call that handles exceptions according to the instructions.
default LLogicalOperator handling(HandlingInstructions<Throwable,RuntimeException> handling)
default boolean apply(boolean a,
@Nonnull
ExWMF<RuntimeException> exF,
@Nonnull
String newMessage,
@Nullable
Object... messageParams)
default LLogicalOperator trying(@Nonnull ExWMF<RuntimeException> exF, @Nonnull String newMessage, @Nullable Object... messageParams)
default boolean apply(boolean a,
@Nonnull
ExWF<RuntimeException> exF)
default LLogicalOperator trying(@Nonnull ExWF<RuntimeException> exF)
default boolean applyThen(boolean a,
@Nonnull
LPredicate<Throwable> handler)
default LLogicalOperator tryingThen(@Nonnull LPredicate<Throwable> handler)
default boolean nestingApply(boolean a)
Function call that handles exceptions by always nesting checked exceptions and propagating the others as is.
default boolean shovingApply(boolean a)
Function call that handles exceptions by always propagating them as is, even when they are undeclared checked ones.
static boolean handlingApply(boolean a,
LLogicalOperator func,
HandlingInstructions<Throwable,RuntimeException> handling)
static boolean tryApply(boolean a,
LLogicalOperator func)
static boolean tryApply(boolean a,
LLogicalOperator func,
@Nonnull
ExWMF<RuntimeException> exF,
@Nonnull
String newMessage,
@Nullable
Object... messageParams)
static boolean tryApply(boolean a,
LLogicalOperator func,
@Nonnull
ExWF<RuntimeException> exF)
static boolean tryApplyThen(boolean a,
LLogicalOperator func,
@Nonnull
LPredicate<Throwable> handler)
default boolean failSafeApply(boolean a,
@Nonnull
LLogicalOperator failSafe)
static boolean failSafeApply(boolean a,
LLogicalOperator func,
@Nonnull
LLogicalOperator failSafe)
static LLogicalOperator failSafe(LLogicalOperator func, @Nonnull LLogicalOperator failSafe)
default boolean doIf(boolean a,
LAction action)
static boolean doIf(boolean a,
@Nonnull
LLogicalOperator predicate,
@Nonnull
LAction action)
static boolean doIf(boolean a,
@Nonnull
LLogicalOperator predicate,
@Nonnull
LBoolConsumer consumer)
default boolean doIf(boolean a,
@Nonnull
LBoolConsumer consumer)
static void throwIf(boolean a,
LLogicalOperator pred,
ExMF<RuntimeException> factory,
@Nonnull
String newMessage,
@Nullable
Object... messageParams)
static void throwIfNot(boolean a,
LLogicalOperator pred,
ExMF<RuntimeException> factory,
@Nonnull
String newMessage,
@Nullable
Object... messageParams)
default boolean nonNullApply(boolean a)
Just to mirror the method: Ensures the result is not null
default boolean doTest(boolean a)
For convenience, boolean operator is also special case of predicate.
@Nonnull default String functionalInterfaceDescription()
Returns description of the functional interface.
functionalInterfaceDescription in interface MetaFunctionalInterfacedefault <V> boolean doIf(V a1,
boolean a2,
LObjBoolConsumer<V> consumer)
default <V> boolean doIf(V a1,
int a2,
boolean a3,
LTieBoolConsumer<? super V> consumer)
default <V> int doIf(V a1,
int a2,
boolean a3,
LTieBoolFunction<? super V> consumer)
static void fromTo(int min_i,
int max_i,
boolean a,
LLogicalOperator func)
From-To. Intended to be used with non-capturing lambda.
static void fromTill(int min_i,
int max_i,
boolean a,
LLogicalOperator func)
From-To. Intended to be used with non-capturing lambda.
static void times(int max_i,
boolean a,
LLogicalOperator func)
From-To. Intended to be used with non-capturing lambda.
default LBoolSupplier capture(boolean a)
Captures arguments but delays the evaluation.
static LLogicalOperator constant(boolean r)
Creates function that always returns the same value.
@Nonnull static LLogicalOperator logicalOp(@Nonnull LLogicalOperator lambda)
Convenient method in case lambda expression is ambiguous for the compiler (that might happen for overloaded methods accepting different interfaces).
@Nonnull static LLogicalOperator recursive(@Nonnull LFunction<LLogicalOperator,LLogicalOperator> selfLambda)
@Nonnull static LLogicalOperator logicalOpThrowing(@Nonnull ExF<Throwable> exF)
@Nonnull static LLogicalOperator logicalOpThrowing(String message, @Nonnull ExMF<Throwable> exF)
static boolean call(boolean a,
@Nonnull
LLogicalOperator lambda)
@Nonnull static LLogicalOperator safe()
Safe instance. That always returns the same value (as produceBoolean).
@Nonnull static LSupplier<LLogicalOperator> safeSupplier()
Safe instance supplier. Returns supplier of safe() instance.
@Nonnull static LLogicalOperator safe(@Nullable LLogicalOperator other)
Safe wrapping. Either argument function is returned (if it is not null) or safe() instance.
@Nonnull static LSupplier<LLogicalOperator> safeSupplier(@Nullable LSupplier<LLogicalOperator> supplier)
Safe supplier. Either argument supplier is returned (if it is not null) or supplier of safe() instance.
@Nonnull default LLogicalOperator negate()
Returns a predicate that represents the logical negation of this predicate.
java.util.function.Predicate#negate}@Nonnull default LLogicalOperator and(@Nonnull LLogicalOperator other)
Returns a predicate that represents the logical AND of evaluation of this predicate and the argument one.
java.util.function.Predicate#and()}@Nonnull default LLogicalOperator or(@Nonnull LLogicalOperator other)
Returns a predicate that represents the logical OR of evaluation of this predicate and the argument one.
java.util.function.Predicate#or}@Nonnull default LLogicalOperator xor(@Nonnull LLogicalOperator other)
Returns a predicate that represents the logical XOR of evaluation of this predicate and the argument one.
java.util.function.Predicate#or}@Nonnull static LLogicalOperator isEqual(boolean target)
Creates predicate that evaluates if an object is equal with the argument one.
java.util.function.Predicate#isEqual()@Nonnull default LLogicalOperator compose(@Nonnull LLogicalOperator before)
Allows to manipulate the domain of the function.
static LLogicalOperator composed(@Nonnull LLogicalOperator before, LLogicalOperator after)
@Nonnull default <V> LPredicate<V> logicalOpCompose(@Nonnull LPredicate<? super V> before)
Allows to manipulate the domain of the function.
static <V> LPredicate<V> composed(@Nonnull LPredicate<? super V> before, LLogicalOperator after)
@Nonnull default <V> LBoolFunction<V> then(@Nonnull LBoolFunction<? extends V> after)
Combines two functions together in a order.
@Nonnull default LBoolToByteFunction thenToByte(@Nonnull LBoolToByteFunction after)
Combines two functions together in a order.
@Nonnull default LBoolToSrtFunction thenToSrt(@Nonnull LBoolToSrtFunction after)
Combines two functions together in a order.
@Nonnull default LBoolToIntFunction thenToInt(@Nonnull LBoolToIntFunction after)
Combines two functions together in a order.
@Nonnull default LBoolToLongFunction thenToLong(@Nonnull LBoolToLongFunction after)
Combines two functions together in a order.
@Nonnull default LBoolToFltFunction thenToFlt(@Nonnull LBoolToFltFunction after)
Combines two functions together in a order.
@Nonnull default LBoolToDblFunction thenToDbl(@Nonnull LBoolToDblFunction after)
Combines two functions together in a order.
@Nonnull default LBoolToCharFunction thenToChar(@Nonnull LBoolToCharFunction after)
Combines two functions together in a order.
@Nonnull default LLogicalOperator thenToBool(@Nonnull LLogicalOperator after)
Combines two functions together in a order.
@Nonnull static LLogicalOperator identity()
Returns a function that always returns its input argument.
static boolean produceBoolean(boolean a)
Does nothing (LLogicalOperator) Operator
default <C0> void forEach(IndexedRead<C0,aType.aBool> ia, C0 source, LBoolConsumer 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.aBool> sa, C0 source, LBoolConsumer 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.