Home
last modified time | relevance | path

Searched refs:isPresent (Results 1 – 16 of 16) sorted by relevance

/libcore/ojluni/src/main/java/java/util/
DOptionalInt.java54 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 …]
DOptionalLong.java54 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 …]
DOptionalDouble.java54 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 …]
DOptional.java141 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/
DFindAnyOpTest.java55 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 …]
DFindFirstOpTest.java48 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()
DMinMaxTest.java55 assertTrue(!countTo(0).stream().min(Integer::compare).isPresent()); in testMinMax()
56 assertTrue(!countTo(0).stream().max(Integer::compare).isPresent()); in testMinMax()
DDistinctOpTest.java73 assertTrue(oi.isPresent()); in testWithUnorderedInfiniteStream()
76 assertTrue(oi.isPresent()); in testWithUnorderedInfiniteStream()
DIntReduceTest.java47 assertFalse(IntStream.empty().reduce(irPlus).isPresent()); in testReduce()
DReduceTest.java53 assertTrue(!countTo(0).stream().reduce(rPlus).isPresent()); in testReduce()
DTabulatorsTest.java224 assertTrue(!reduced.isPresent()); in assertValue()
225 else if (!reduced.isPresent()) { in assertValue()
/libcore/ojluni/src/main/java/java/util/stream/
DFindOps.java59 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/
DOptionalIntTest.java45 assertTrue(OptionalInt.of(56).isPresent()); in testIsPresent()
46 assertFalse(OptionalInt.empty().isPresent()); in testIsPresent()
DOptionalLongTest.java45 assertTrue(OptionalLong.of(56).isPresent()); in testIsPresent()
46 assertFalse(OptionalLong.empty().isPresent()); in testIsPresent()
DOptionalDoubleTest.java47 assertTrue(OptionalDouble.of(56.0).isPresent()); in testIsPresent()
48 assertFalse(OptionalDouble.empty().isPresent()); in testIsPresent()
DOptionalTest.java59 assertFalse(empty.isPresent()); in testIsPresent()
62 assertTrue(optionalFoo.isPresent()); in testIsPresent()
64 assertFalse(Optional.<String>ofNullable(null).isPresent()); in testIsPresent()