Most visited

Recently visited

Added in API level 24

DoublePredicate

public interface DoublePredicate

java.util.function.DoublePredicate


表示一个double参数的谓词(布尔值函数)。 这是double Predicate原始类型的Predicate

这是一个 functional interface,其功能方法是 test(double)

也可以看看:

Summary

Public methods

default DoublePredicate and(DoublePredicate other)

返回一个组合谓词,表示谓词与其他谓词的短路逻辑AND。

default DoublePredicate negate()

返回表示谓词逻辑否定的谓词。

default DoublePredicate or(DoublePredicate other)

返回一个组合谓词,表示谓词与其他谓词的短路逻辑或。

abstract boolean test(double value)

根据给定的参数评估这个谓词。

Public methods

and

Added in API level 24
DoublePredicate and (DoublePredicate other)

返回一个组合谓词,表示谓词与其他谓词的短路逻辑AND。 在评估组合谓词时,如果此谓词为false ,则不评估other谓词。

在判断谓词期间抛出的任何异常都会传递给调用者; 如果此断言的评价抛出一个异常,该other断言不会被评估。

Parameters
other DoublePredicate: a predicate that will be logically-ANDed with this predicate
Returns
DoublePredicate a composed predicate that represents the short-circuiting logical AND of this predicate and the other predicate
Throws
NullPointerException if other is null

negate

Added in API level 24
DoublePredicate negate ()

返回表示谓词逻辑否定的谓词。

Returns
DoublePredicate a predicate that represents the logical negation of this predicate

or

Added in API level 24
DoublePredicate or (DoublePredicate other)

返回一个组合谓词,表示谓词与其他谓词的短路逻辑或。 在评估组合谓词时,如果此谓词为true ,则不评估other谓词。

在判断谓词期间抛出的任何异常都会传递给调用者; 如果此断言的评价抛出一个异常,该other断言不会被评估。

Parameters
other DoublePredicate: a predicate that will be logically-ORed with this predicate
Returns
DoublePredicate a composed predicate that represents the short-circuiting logical OR of this predicate and the other predicate
Throws
NullPointerException if other is null

test

Added in API level 24
boolean test (double value)

根据给定的参数评估这个谓词。

Parameters
value double: the input argument
Returns
boolean true if the input argument matches the predicate, otherwise false

Hooray!