/libcore/ojluni/src/main/java/java/util/ |
D | OptionalInt.java | 54 private final boolean isPresent; field in OptionalInt 64 this.isPresent = false; in OptionalInt() 89 this.isPresent = true; in OptionalInt() 113 if (!isPresent) { in getAsInt() 124 public boolean isPresent() { in isPresent() method in OptionalInt 125 return isPresent; in isPresent() 137 if (isPresent) in ifPresent() 148 return isPresent ? value : other; in orElse() 162 return isPresent ? value : other.getAsInt(); in orElseGet() 182 if (isPresent) { in orElseThrow() [all …]
|
D | OptionalLong.java | 54 private final boolean isPresent; field in OptionalLong 64 this.isPresent = false; in OptionalLong() 89 this.isPresent = true; in OptionalLong() 113 if (!isPresent) { in getAsLong() 124 public boolean isPresent() { in isPresent() method in OptionalLong 125 return isPresent; in isPresent() 137 if (isPresent) in ifPresent() 148 return isPresent ? value : other; in orElse() 162 return isPresent ? value : other.getAsLong(); in orElseGet() 182 if (isPresent) { in orElseThrow() [all …]
|
D | OptionalDouble.java | 54 private final boolean isPresent; field in OptionalDouble 64 this.isPresent = false; in OptionalDouble() 89 this.isPresent = true; in OptionalDouble() 113 if (!isPresent) { in getAsDouble() 124 public boolean isPresent() { in isPresent() method in OptionalDouble 125 return isPresent; in isPresent() 137 if (isPresent) in ifPresent() 148 return isPresent ? value : other; in orElse() 162 return isPresent ? value : other.getAsDouble(); in orElseGet() 182 if (isPresent) { in orElseThrow() [all …]
|
D | Optional.java | 141 public boolean isPresent() { in isPresent() method in Optional 171 if (!isPresent()) in filter() 208 if (!isPresent()) in map() 234 if (!isPresent()) in flatMap()
|
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ |
D | FindAnyOpTest.java | 55 assertFalse(Collections.emptySet().stream().findAny().isPresent(), "no result"); in testFindAny() 56 assertFalse(countTo(10).stream().filter(x -> x > 10).findAny().isPresent(), "no result"); in testFindAny() 57 assertTrue(countTo(10).stream().filter(pEven).findAny().isPresent(), "with result"); in testFindAny() 61 assertFalse(Collections.emptySet().parallelStream().findAny().isPresent(), "no result"); in testFindAnyParallel() 62 …assertFalse(countTo(1000).parallelStream().filter(x -> x > 1000).findAny().isPresent(), "no result… in testFindAnyParallel() 63 … assertTrue(countTo(1000).parallelStream().filter(pEven).findAny().isPresent(), "with result"); in testFindAnyParallel() 76 if (or.isPresent()) { in exerciseStream() 100 if (or.isPresent()) { in exerciseIntStream() 124 if (or.isPresent()) { in exerciseLongStream() 148 if (or.isPresent()) { in exerciseDoubleStream() [all …]
|
D | FindFirstOpTest.java | 48 assertFalse(Collections.emptySet().stream().findFirst().isPresent(), "no result"); in testFindFirst() 49 assertFalse(countTo(10).stream().filter(x -> x > 10).findFirst().isPresent(), "no result"); in testFindFirst() 69 if (r.isPresent()) { in exerciseStream() 89 if (r.isPresent()) { in exerciseIntStream() 109 if (r.isPresent()) { in exerciseLongStream() 129 if (r.isPresent()) { in exerciseDoubleStream()
|
D | MinMaxTest.java | 55 assertTrue(!countTo(0).stream().min(Integer::compare).isPresent()); in testMinMax() 56 assertTrue(!countTo(0).stream().max(Integer::compare).isPresent()); in testMinMax()
|
D | DistinctOpTest.java | 73 assertTrue(oi.isPresent()); in testWithUnorderedInfiniteStream() 76 assertTrue(oi.isPresent()); in testWithUnorderedInfiniteStream()
|
D | IntReduceTest.java | 47 assertFalse(IntStream.empty().reduce(irPlus).isPresent()); in testReduce()
|
D | ReduceTest.java | 53 assertTrue(!countTo(0).stream().reduce(rPlus).isPresent()); in testReduce()
|
D | TabulatorsTest.java | 224 assertTrue(!reduced.isPresent()); in assertValue() 225 else if (!reduced.isPresent()) { in assertValue()
|
/libcore/ojluni/src/main/java/java/util/stream/ |
D | FindOps.java | 59 Optional::isPresent, FindSink.OfRef::new); in makeRef() 71 OptionalInt::isPresent, FindSink.OfInt::new); in makeInt() 83 OptionalLong::isPresent, FindSink.OfLong::new); in makeLong() 95 OptionalDouble::isPresent, FindSink.OfDouble::new); in makeDouble()
|
/libcore/luni/src/test/java/libcore/java/util/ |
D | OptionalIntTest.java | 45 assertTrue(OptionalInt.of(56).isPresent()); in testIsPresent() 46 assertFalse(OptionalInt.empty().isPresent()); in testIsPresent()
|
D | OptionalLongTest.java | 45 assertTrue(OptionalLong.of(56).isPresent()); in testIsPresent() 46 assertFalse(OptionalLong.empty().isPresent()); in testIsPresent()
|
D | OptionalDoubleTest.java | 47 assertTrue(OptionalDouble.of(56.0).isPresent()); in testIsPresent() 48 assertFalse(OptionalDouble.empty().isPresent()); in testIsPresent()
|
D | OptionalTest.java | 59 assertFalse(empty.isPresent()); in testIsPresent() 62 assertTrue(optionalFoo.isPresent()); in testIsPresent() 64 assertFalse(Optional.<String>ofNullable(null).isPresent()); in testIsPresent()
|