P1
- parameter type 1P2
- parameter type 2P3
- parameter type 3P4
- parameter type 4P5
- parameter type 5P6
- parameter type 6@FunctionalInterface
public interface Predicate6<P1,P2,P3,P4,P5,P6>
and(Predicate6)
, or(Predicate6)
,
xor(Predicate6)
, and negate()
.
There is a general problem with combining types which don't
allow to use the above combination methods in all cases
similar to standard Java's logical expressions. The following
static methods of this interface may be used in all cases:
and(Predicate6, Predicate6)
,
or(Predicate6, Predicate6)
,
and xor(Predicate6, Predicate6)
.
Useful for start values in algorithms or as default values
are the two values returned by alwaysTrue()
(a predicate which always returns true
regardless
the argument applied to the test(Object, Object, Object, Object, Object, Object)
method)
and alwaysFalse()
(same for false
).
Partial evaluation is also possible.
Predicate1
,
Predicate2
,
Predicate3
,
Predicate4
,
Predicate5
,
Predicate7
,
Predicate8
,
Predicate9
Modifier and Type | Method and Description |
---|---|
static <T1,T2,T3,T4,T5,T6> |
alwaysFalse()
Get a predicate which always evaluates to
false . |
static <T1,T2,T3,T4,T5,T6> |
alwaysTrue()
Get a predicate which always evaluates to
true . |
default Predicate6<P1,P2,P3,P4,P5,P6> |
and(Predicate6<? super P1,? super P2,? super P3,? super P4,? super P5,? super P6> other)
Combine this and another predicate with logical and.
|
static <T1,T2,T3,T4,T5,T6> |
and(Predicate6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6> pred1,
Predicate6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6> pred2)
Get a predicate which is the combination of two predicates
with a logical and.
|
default Predicate6<P1,P2,P3,P4,P5,P6> |
negate()
Get the negation of this predicate.
|
default Predicate6<P1,P2,P3,P4,P5,P6> |
or(Predicate6<? super P1,? super P2,? super P3,? super P4,? super P5,? super P6> other)
Combine this and another predicate with logical or.
|
static <T1,T2,T3,T4,T5,T6> |
or(Predicate6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6> pred1,
Predicate6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6> pred2)
Get a predicate which is the combination of two predicates
with a logical or.
|
default Predicate5<P2,P3,P4,P5,P6> |
partial1(P1 argument)
Get a partially applied predicate with a fix first argument.
|
default Predicate5<P1,P3,P4,P5,P6> |
partial2(P2 argument)
Get a partially applied predicate with a fix second argument.
|
default Predicate5<P1,P2,P4,P5,P6> |
partial3(P3 argument)
Get a partially applied predicate with a fix third argument.
|
default Predicate5<P1,P2,P3,P5,P6> |
partial4(P4 argument)
Get a partially applied predicate with a fix fourth argument.
|
default Predicate5<P1,P2,P3,P4,P6> |
partial5(P5 argument)
Get a partially applied predicate with a fix fifth argument.
|
default Predicate5<P1,P2,P3,P4,P5> |
partial6(P6 argument)
Get a partially applied predicate with a fix sixth argument.
|
boolean |
test(P1 arg1,
P2 arg2,
P3 arg3,
P4 arg4,
P5 arg5,
P6 arg6)
Test the given values.
|
default Predicate6<P1,P2,P3,P4,P5,P6> |
xor(Predicate6<? super P1,? super P2,? super P3,? super P4,? super P5,? super P6> other)
Combine this and another predicate with logical exclusive or.
|
static <T1,T2,T3,T4,T5,T6> |
xor(Predicate6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6> pred1,
Predicate6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6> pred2)
Get a predicate which is the combination of two predicates
with a logical exclusive or.
|
boolean test(P1 arg1, P2 arg2, P3 arg3, P4 arg4, P5 arg5, P6 arg6)
arg1
- function argument 1arg2
- function argument 2arg3
- function argument 3arg4
- function argument 4arg5
- function argument 5arg6
- function argument 6true
or false
@NotNull default Predicate6<P1,P2,P3,P4,P5,P6> and(@NotNull Predicate6<? super P1,? super P2,? super P3,? super P4,? super P5,? super P6> other)
false
the other one is
not evaluated.
This method has a problem if either one of the argument types
pf the parameter is not a super class of this predicate's
parameter types. See and(Predicate6, Predicate6)
for such cases.other
- other predicate to be chained with logical and@NotNull default Predicate6<P1,P2,P3,P4,P5,P6> or(@NotNull Predicate6<? super P1,? super P2,? super P3,? super P4,? super P5,? super P6> other)
true
the other one is
not evaluated.
This method has a problem if either one of the argument types
pf the parameter is not a super class of this predicate's
parameter types. See or(Predicate6, Predicate6)
for such cases.other
- other predicate to be chained with logical or@NotNull default Predicate6<P1,P2,P3,P4,P5,P6> xor(@NotNull Predicate6<? super P1,? super P2,? super P3,? super P4,? super P5,? super P6> other)
xor(Predicate6, Predicate6)
for such cases.other
- other predicate to be chained with logical exclusive or@NotNull default Predicate6<P1,P2,P3,P4,P5,P6> negate()
@NotNull default Predicate5<P2,P3,P4,P5,P6> partial1(P1 argument)
argument
- value applied for first argument@NotNull default Predicate5<P1,P3,P4,P5,P6> partial2(P2 argument)
argument
- value applied for second argument@NotNull default Predicate5<P1,P2,P4,P5,P6> partial3(P3 argument)
argument
- value applied for third argument@NotNull default Predicate5<P1,P2,P3,P5,P6> partial4(P4 argument)
argument
- value applied for fourth argument@NotNull default Predicate5<P1,P2,P3,P4,P6> partial5(P5 argument)
argument
- value applied for fifth argument@NotNull default Predicate5<P1,P2,P3,P4,P5> partial6(P6 argument)
argument
- value applied for sixth argument@NotNull static <T1,T2,T3,T4,T5,T6> Predicate6<T1,T2,T3,T4,T5,T6> alwaysTrue()
true
.T1
- type of first predicate parameterT2
- type of second predicate parameterT3
- type of third predicate parameterT4
- type of fourth predicate parameterT5
- type of fifth predicate parameterT6
- type of sixth predicate parametertrue
@NotNull static <T1,T2,T3,T4,T5,T6> Predicate6<T1,T2,T3,T4,T5,T6> alwaysFalse()
false
.T1
- type of first predicate parameterT2
- type of second predicate parameterT3
- type of third predicate parameterT4
- type of fourth predicate parameterT5
- type of fifth predicate parameterT6
- type of sixth predicate parameterfalse
@NotNull static <T1,T2,T3,T4,T5,T6> Predicate6<T1,T2,T3,T4,T5,T6> and(@NotNull Predicate6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6> pred1, @NotNull Predicate6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6> pred2)
false
the other one is
not evaluated.T1
- resulting type of first argument,
which is the most extending type of both pred1
's
first argument type and pred2
's first argument type,
so if neither type is extending the
other this method will not compileT2
- resulting type of second argument, see <T1>
for the fine printT3
- resulting type of third argument, see <T1>
for the fine printT4
- resulting type of fourth argument, see <T1>
for the fine printT5
- resulting type of fifth argument, see <T1>
for the fine printT6
- resulting type of sixth argument, see <T1>
for the fine printpred1
- first predicatepred2
- second predicateand(Predicate6)
@NotNull static <T1,T2,T3,T4,T5,T6> Predicate6<T1,T2,T3,T4,T5,T6> or(@NotNull Predicate6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6> pred1, @NotNull Predicate6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6> pred2)
true
the other one is
not evaluated.T1
- resulting type of first argument,
which is the most extending type of both pred1
's
first argument type and pred2
's first argument type,
so if neither type is extending the
other this method will not compileT2
- resulting type of second argument, see <T1>
for the fine printT3
- resulting type of third argument, see <T1>
for the fine printT4
- resulting type of fourth argument, see <T1>
for the fine printT5
- resulting type of fifth argument, see <T1>
for the fine printT6
- resulting type of sicth argument, see <T1>
for the fine printpred1
- first predicatepred2
- second predicateor(Predicate6)
@NotNull static <T1,T2,T3,T4,T5,T6> Predicate6<T1,T2,T3,T4,T5,T6> xor(@NotNull Predicate6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6> pred1, @NotNull Predicate6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6> pred2)
true
the other one is
not evaluated.T1
- resulting type of first argument,
which is the most extending type of both pred1
's
first argument type and pred2
's first argument type,
so if neither type is extending the
other this method will not compileT2
- resulting type of second argument, see <T1>
for the fine printT3
- resulting type of third argument, see <T1>
for the fine printT4
- resulting type of fourth argument, see <T1>
for the fine printT5
- resulting type of fifth argument, see <T1>
for the fine printT6
- resulting type of sixth argument, see <T1>
for the fine printpred1
- first predicatepred2
- second predicatexor(Predicate6)