public interface BiPredicate
| java.util.function.BiPredicate<T, U> |
表示两个参数的谓词(布尔值函数)。 这是Predicate专业化。
这是一个 functional interface,其功能方法是 test(Object, Object) 。
也可以看看:
Public methods |
|
|---|---|
default BiPredicate<T, U> |
and(BiPredicate<? super T, ? super U> other) 返回一个组合谓词,表示谓词与其他谓词的短路逻辑AND。 |
default BiPredicate<T, U> |
negate() 返回表示谓词逻辑否定的谓词。 |
default BiPredicate<T, U> |
or(BiPredicate<? super T, ? super U> other) 返回一个组合谓词,表示谓词与其他谓词的短路逻辑或。 |
abstract boolean |
test(T t, U u) 在给定的参数上评估这个谓词。 |
BiPredicate<T, U> and (BiPredicate<? super T, ? super U> other)
返回一个组合谓词,表示谓词与其他谓词的短路逻辑AND。 在评估组合谓词时,如果此谓词为false ,则不评估other谓词。
在判断谓词期间抛出的任何异常都会传递给调用者; 如果此谓词的评估引发异常,则不会评估other谓词。
| Parameters | |
|---|---|
other |
BiPredicate: a predicate that will be logically-ANDed with this predicate |
| Returns | |
|---|---|
BiPredicate<T, U> |
a composed predicate that represents the short-circuiting logical AND of this predicate and the other predicate |
| Throws | |
|---|---|
NullPointerException |
if other is null |
BiPredicate<T, U> negate ()
返回表示谓词逻辑否定的谓词。
| Returns | |
|---|---|
BiPredicate<T, U> |
a predicate that represents the logical negation of this predicate |
BiPredicate<T, U> or (BiPredicate<? super T, ? super U> other)
返回一个组合谓词,表示谓词与其他谓词的短路逻辑或。 在评估组合谓词时,如果此谓词为true ,则不评估other谓词。
在判断谓词期间抛出的任何异常都会传递给调用者; 如果此谓词的评估引发异常,则不会评估other谓词。
| Parameters | |
|---|---|
other |
BiPredicate: a predicate that will be logically-ORed with this predicate |
| Returns | |
|---|---|
BiPredicate<T, U> |
a composed predicate that represents the short-circuiting logical OR of this predicate and the other predicate |
| Throws | |
|---|---|
NullPointerException |
if other is null |
boolean test (T t,
U u)
在给定的参数上评估这个谓词。
| Parameters | |
|---|---|
t |
T: the first input argument |
u |
U: the second input argument |
| Returns | |
|---|---|
boolean |
true if the input arguments match the predicate, otherwise false |