Interface DoublePredicate
- All Superinterfaces:
DoublePredicate,Predicate<@NotNull Double>
- All Known Subinterfaces:
DoubleRange
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Predicate for double.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull DoublePredicateCreates a predicate which is alwaysfalse.static @NotNull DoublePredicateCreates a predicate which is alwaystrue.default @NotNull DoublePredicatedefault @NotNull DoublePredicateand(@NonNull DoublePredicate other) Returns a composed predicate that represents a short-circuiting logical AND of this predicate and another.default @NotNull DoublePredicateand(DoublePredicate other) static @NotNull DoublePredicateisEqual(double value) Returns a predicate that tests if two arguments are equal.static @NotNull DoublePredicateisNotEqual(double value) Returns a predicate that tests if two arguments are not equal.default @NotNull DoublePredicatenegate()default @NotNull DoublePredicatedefault @NotNull DoublePredicateor(@NonNull DoublePredicate other) Returns a composed predicate that represents a short-circuiting logical OR of this predicate and another.default @NotNull DoublePredicateor(DoublePredicate other) default booleantest(double value) default booleanbooleantestAsDouble(double value) Evaluates this predicate on the given argument.
-
Method Details
-
testAsDouble
boolean testAsDouble(double value) Evaluates this predicate on the given argument.- Parameters:
value- the input argument- Returns:
trueif the input argument matches the predicate orfalseotherwise
-
test
default boolean test(double value) - Specified by:
testin interfaceDoublePredicate
-
test
-
and
@Contract(value="null -> fail; _ -> _", pure=true) @NotNull default @NotNull DoublePredicate and(@NonNull @NonNull DoublePredicate other) Returns a composed predicate that represents a short-circuiting logical AND of this predicate and another. When evaluating the composed predicate, if this predicate is
false, then theotherpredicate is not evaluated.Any exceptions thrown during evaluation of either predicate are relayed to the caller; if evaluation of this predicate throws an exception, the
otherpredicate will not be evaluated.- Parameters:
other- a predicate that will be logically-ANDed with this predicate- Returns:
- a composed predicate that represents the short-circuiting logical AND
of this predicate and the
otherpredicate - Throws:
NullPointerException- if other isnull
-
and
@Contract(value="null -> fail; _ -> _", pure=true) @NotNull default @NotNull DoublePredicate and(@NonNull @NonNull Predicate<@NotNull ? super Double> other) -
and
@Contract(value="null -> fail; _ -> _", pure=true) @NotNull default @NotNull DoublePredicate and(@NonNull DoublePredicate other) - Specified by:
andin interfaceDoublePredicate
-
or
@Contract(value="null -> fail; _ -> _", pure=true) @NotNull default @NotNull DoublePredicate or(@NonNull @NonNull DoublePredicate other) Returns a composed predicate that represents a short-circuiting logical OR of this predicate and another. When evaluating the composed predicate, if this predicate is
true, then theotherpredicate is not evaluated.Any exceptions thrown during evaluation of either predicate are relayed to the caller; if evaluation of this predicate throws an exception, the
otherpredicate will not be evaluated.- Parameters:
other- a predicate that will be logically-ORed with this predicate- Returns:
- a composed predicate that represents the short-circuiting logical OR
of this predicate and the
otherpredicate - Throws:
NullPointerException- if other isnull
-
or
@Contract(value="null -> fail; _ -> _", pure=true) @NotNull default @NotNull DoublePredicate or(@NonNull @NonNull Predicate<@NotNull ? super Double> other) -
or
@Contract(value="null -> fail; _ -> _", pure=true) @NotNull default @NotNull DoublePredicate or(@NonNull DoublePredicate other) - Specified by:
orin interfaceDoublePredicate
-
negate
- Specified by:
negatein interfaceDoublePredicate- Specified by:
negatein interfacePredicate<@NotNull Double>
-
isEqual
Returns a predicate that tests if two arguments are equal.- Parameters:
value- value with which to compare the tested one- Returns:
- a predicate that tests if two arguments are equal
-
isNotEqual
@Contract(value="_ -> _", pure=true) @NotNull static @NotNull DoublePredicate isNotEqual(double value) Returns a predicate that tests if two arguments are not equal.- Parameters:
value- value with which to compare the tested one- Returns:
- a predicate that tests if two arguments are not equal
-
alwaysTrue
Creates a predicate which is alwaystrue.- Returns:
- predicate which is always
true
-
alwaysFalse
Creates a predicate which is alwaysfalse.- Returns:
- predicate which is always
false
-