Home
last modified time | relevance | path

Searched refs:OptionalDouble (Results 1 – 22 of 22) sorted by relevance

/libcore/luni/src/test/java/libcore/java/util/
DOptionalDoubleTest.java24 import java.util.OptionalDouble;
33 assertSame(OptionalDouble.empty(), OptionalDouble.empty()); in testEmpty_sameInstance()
37 assertEquals(56.0, OptionalDouble.of(56.0).getAsDouble()); in testGet()
40 OptionalDouble.empty().getAsDouble(); in testGet()
47 assertTrue(OptionalDouble.of(56.0).isPresent()); in testIsPresent()
48 assertFalse(OptionalDouble.empty().isPresent()); in testIsPresent()
53 OptionalDouble.empty().ifPresent(alwaysFails); in testIfPresent()
57 OptionalDouble.of(56.0).ifPresent(recorder); in testIfPresent()
62 assertEquals(57.0, OptionalDouble.empty().orElse(57.0)); in testOrElse()
63 assertEquals(56.0, OptionalDouble.of(56.0).orElse(57.0)); in testOrElse()
[all …]
/libcore/ojluni/src/test/java/util/Optional/
DBasicDouble.java41 import java.util.OptionalDouble;
54 void checkEmpty(OptionalDouble empty) { in checkEmpty()
55 assertTrue(empty.equals(OptionalDouble.empty())); in checkEmpty()
56 assertTrue(OptionalDouble.empty().equals(empty)); in checkEmpty()
57 assertFalse(empty.equals(OptionalDouble.of(UNEXPECTED))); in checkEmpty()
58 assertFalse(OptionalDouble.of(UNEXPECTED).equals(empty)); in checkEmpty()
94 void checkPresent(OptionalDouble opt, double expected) { in checkPresent()
95 assertFalse(opt.equals(OptionalDouble.empty())); in checkPresent()
96 assertFalse(OptionalDouble.empty().equals(opt)); in checkPresent()
97 assertTrue(opt.equals(OptionalDouble.of(expected))); in checkPresent()
[all …]
/libcore/ojluni/src/main/java/java/util/
DOptionalDouble.java59 public final class OptionalDouble { class
63 private static final OptionalDouble EMPTY = new OptionalDouble();
77 private OptionalDouble() { in OptionalDouble() method in OptionalDouble
94 public static OptionalDouble empty() { in empty()
103 private OptionalDouble(double value) { in OptionalDouble() method in OptionalDouble
114 public static OptionalDouble of(double value) { in of()
115 return new OptionalDouble(value); in of()
298 return obj instanceof OptionalDouble other in equals()
/libcore/ojluni/src/main/java/java/util/stream/
DFindOps.java28 import java.util.OptionalDouble;
92 public static TerminalOp<Double, OptionalDouble> makeDouble(boolean mustFindFirst) { in makeDouble()
251 static final class OfDouble extends FindSink<Double, OptionalDouble>
260 public OptionalDouble get() { in get()
261 return hasValue ? OptionalDouble.of(value) : null; in get()
264 static final TerminalOp<Double, OptionalDouble> OP_FIND_FIRST = new FindOp<>(true,
265 StreamShape.DOUBLE_VALUE, OptionalDouble.empty(),
266 OptionalDouble::isPresent, FindSink.OfDouble::new);
267 static final TerminalOp<Double, OptionalDouble> OP_FIND_ANY = new FindOp<>(false,
268 StreamShape.DOUBLE_VALUE, OptionalDouble.empty(),
[all …]
DDoubleStream.java30 import java.util.OptionalDouble;
584 OptionalDouble reduce(DoubleBinaryOperator op); in reduce()
725 OptionalDouble min(); in min()
746 OptionalDouble max(); in max()
801 OptionalDouble average(); in average()
894 OptionalDouble findFirst(); in findFirst()
913 OptionalDouble findAny(); in findAny()
DDoublePipeline.java29 import java.util.OptionalDouble;
483 public final OptionalDouble min() {
488 public final OptionalDouble max() {
502 public final OptionalDouble average() {
524 ? OptionalDouble.of(Collectors.computeFinalSum(avg) / avg[2])
525 : OptionalDouble.empty();
545 public final OptionalDouble reduce(DoubleBinaryOperator op) {
577 public final OptionalDouble findFirst() {
582 public final OptionalDouble findAny() {
DReduceOps.java29 import java.util.OptionalDouble;
679 public static TerminalOp<Double, OptionalDouble>
683 implements AccumulatingSink<Double, OptionalDouble, ReducingSink>, Sink.OfDouble {
704 public OptionalDouble get() {
705 return empty ? OptionalDouble.empty() : OptionalDouble.of(state);
714 return new ReduceOp<Double, OptionalDouble, ReducingSink>(StreamShape.DOUBLE_VALUE) {
DIntPipeline.java29 import java.util.OptionalDouble;
510 public final OptionalDouble average() {
521 ? OptionalDouble.of((double) avg[1] / avg[0])
522 : OptionalDouble.empty();
DLongPipeline.java29 import java.util.OptionalDouble;
488 public final OptionalDouble average() {
499 ? OptionalDouble.of((double) avg[1] / avg[0])
500 : OptionalDouble.empty();
DIntStream.java30 import java.util.OptionalDouble;
719 OptionalDouble average(); in average()
DLongStream.java30 import java.util.OptionalDouble;
720 OptionalDouble average(); in average()
/libcore/ojluni/annotations/flagged_api/java/util/stream/
DDoubleStream.annotated.java70 public java.util.OptionalDouble reduce(java.util.function.DoubleBinaryOperator op); in reduce()
76 public java.util.OptionalDouble min(); in min()
78 public java.util.OptionalDouble max(); in max()
82 public java.util.OptionalDouble average(); in average()
92 public java.util.OptionalDouble findFirst(); in findFirst()
94 public java.util.OptionalDouble findAny(); in findAny()
DIntStream.annotated.java82 public java.util.OptionalDouble average(); in average()
DLongStream.annotated.java82 public java.util.OptionalDouble average(); in average()
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DMinMaxTest.java33 import java.util.OptionalDouble;
94 assertEquals(DoubleStream.empty().min(), OptionalDouble.empty()); in testDoubleMinMax()
95 assertEquals(DoubleStream.empty().max(), OptionalDouble.empty()); in testDoubleMinMax()
DFindAnyOpTest.java135OptionalDouble or = withData(data).terminal(fs, s -> s.findAny()).equalator(DOUBLE_VALID_ANSWER).e… in exerciseDoubleStream()
156 …static final BiConsumer<OptionalDouble, OptionalDouble> DOUBLE_VALID_ANSWER = (a, b) -> assertEqua…
DSortedOpTest.java330 assertEquals(knownSize.apply(1).findFirst(), OptionalDouble.of(1)); in testDoubleSequentialShortCircuitTerminal()
331 assertEquals(knownSize.apply(1).findAny(), OptionalDouble.of(1)); in testDoubleSequentialShortCircuitTerminal()
332 assertEquals(unknownSize.apply(1).findFirst(), OptionalDouble.of(1)); in testDoubleSequentialShortCircuitTerminal()
333 assertEquals(unknownSize.apply(1).findAny(), OptionalDouble.of(1)); in testDoubleSequentialShortCircuitTerminal()
DFindFirstOpTest.java132 OptionalDouble r = exerciseTerminalOps(data, fs, s -> s.findFirst()); in exerciseDoubleStream()
/libcore/ojluni/src/test/java/util/stream/testlib/org/openjdk/testlib/java/util/stream/
DDefaultMethodStreams.java35 import java.util.OptionalDouble;
503 public OptionalDouble average() { in average()
709 public OptionalDouble average() { in average()
877 public OptionalDouble reduce(DoubleBinaryOperator op) { in reduce()
892 public OptionalDouble min() { in min()
897 public OptionalDouble max() { in max()
907 public OptionalDouble average() { in average()
932 public OptionalDouble findFirst() { in findFirst()
937 public OptionalDouble findAny() { in findAny()
/libcore/api/
Dcurrent.txt14540 public final class OptionalDouble {
14541 method public static java.util.OptionalDouble empty();
14547 method public static java.util.OptionalDouble of(double);
18241 method public java.util.OptionalDouble average();
18251 method public java.util.OptionalDouble findAny();
18252 method public java.util.OptionalDouble findFirst();
18266 method public java.util.OptionalDouble max();
18267 method public java.util.OptionalDouble min();
18274 method public java.util.OptionalDouble reduce(java.util.function.DoubleBinaryOperator);
18299 method public java.util.OptionalDouble average();
[all …]
/libcore/
Dopenjdk_java_files.bp960 "ojluni/src/main/java/java/util/OptionalDouble.java",
DEXPECTED_UPSTREAM974 …jluni/src/main/java/java/util/OptionalDouble.java,jdk17u/jdk-17.0.6-ga,src/java.base/share/classes…