@FunctionalInterface public interface DoublePredicate2 extends Predicate2<java.lang.Double,java.lang.Double>
Modifier and Type | Field and Description |
---|---|
static DoublePredicate2 |
EQUAL_EVEN_NAN
Predicate which checks whether two double values are equal
which handles NaN values in a way that
Double.NaN == Double.NaN
is true . |
static DoublePredicate2 |
EQUAL_STANDARD
Predicate which checks whether two float values are equal
which handles NaN as defined by IEEE 745 so that
Float.NaN == Float.NaN
is false , i.e. |
ALWAYS_FALSE, ALWAYS_TRUE
Modifier and Type | Method and Description |
---|---|
default boolean |
test(java.lang.Double value1,
java.lang.Double value2)
Default implementation.
|
default boolean |
test(DoublePair pair)
Test a double pair by expanding its elements.
|
boolean |
testDoubles(double value1,
double value2)
Test the given value.
|
after1, after2, after3, after5, after6, after7, after8, after9, alwaysFalse, alwaysTrue, and, and, apply, areIdentical, from, isEqual, negate, or, or, partial1, partial2, partialLeft, partialRight, reverseOrder, test, xor, xor
@NotNull static final DoublePredicate2 EQUAL_EVEN_NAN
Double.NaN == Double.NaN
is true
. It also handles -0.0 == 0.0
in a better way
than standard Java using Double.compare(double, double)
which considers
them different, although above equality is true
.@NotNull static final DoublePredicate2 EQUAL_STANDARD
Float.NaN == Float.NaN
is false
, i.e. NaN is different from any other value including
itself.EQUAL_EVEN_NAN
boolean testDoubles(double value1, double value2)
value1
- first value to testvalue2
- second value to testtrue
if the values match the predicate, false
otherwisedefault boolean test(java.lang.Double value1, java.lang.Double value2)
testDoubles(double, double)
.
Double.NaN
will be used instead of null
.test
in interface java.util.function.BiPredicate<java.lang.Double,java.lang.Double>
value1
- first valuevalue2
- second valuetrue
if the values match the predicate, false
otherwisedefault boolean test(@NotNull DoublePair pair)
pair
- pair to testjava.lang.NullPointerException
- if pair is null