Home
last modified time | relevance | path

Searched refs:reduce (Results 1 – 25 of 25) sorted by relevance

/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DReduceTest.java47 assertEquals(55, (int) list.stream().reduce(rPlus).get()); in testReduce()
48 assertEquals(55, (int) list.stream().reduce(0, rPlus)); in testReduce()
49 assertEquals(10, (int) list.stream().reduce(rMax).get()); in testReduce()
50 assertEquals(1, (int) list.stream().reduce(rMin).get()); in testReduce()
52 assertEquals(0, (int) countTo(0).stream().reduce(0, rPlus)); in testReduce()
53 assertTrue(!countTo(0).stream().reduce(rPlus).isPresent()); in testReduce()
55 assertEquals(110, (int) list.stream().map(mDoubler).reduce(rPlus).get()); in testReduce()
56 assertEquals(20, (int) list.stream().map(mDoubler).reduce(rMax).get()); in testReduce()
57 assertEquals(2, (int) list.stream().map(mDoubler).reduce(rMin).get()); in testReduce()
62 …assertEquals(0, (int) exerciseTerminalOps(data, s -> s.filter(pFalse), s -> s.reduce(0, rPlus, rPl… in testOps()
[all …]
DIntReduceTest.java41 assertEquals(55, Arrays.stream(a).reduce(irPlus).getAsInt()); in testReduce()
42 assertEquals(55, Arrays.stream(a).reduce(0, irPlus)); in testReduce()
43 assertEquals(10, Arrays.stream(a).reduce(irMax).getAsInt()); in testReduce()
44 assertEquals(1, Arrays.stream(a).reduce(irMin).getAsInt()); in testReduce()
46 assertEquals(0, IntStream.empty().reduce(0, irPlus)); in testReduce()
47 assertFalse(IntStream.empty().reduce(irPlus).isPresent()); in testReduce()
49 assertEquals(110, Arrays.stream(a).map(irDoubler).reduce(irPlus).getAsInt()); in testReduce()
50 assertEquals(20, Arrays.stream(a).map(irDoubler).reduce(irMax).getAsInt()); in testReduce()
51 assertEquals(2, Arrays.stream(a).map(irDoubler).reduce(irMin).getAsInt()); in testReduce()
56 …assertEquals(0, (int) exerciseTerminalOps(data, s -> s.filter(ipFalse), s -> s.reduce(0, irPlus))); in testOps()
[all …]
DPrimitiveSumTest.java49 expectedResult(data.stream().asLongStream().reduce(0, LambdaTestHelpers.lrPlus)). in testOps()
59 expectedResult(data.stream().reduce(0, LambdaTestHelpers.lrPlus)). in testOps()
73 expectedResult(data.stream().reduce(0, LambdaTestHelpers.drPlus)). in testOps()
DTabulatorsTest.java136 .reduce(mergeFn) in assertValue()
222 Optional<U> reduced = source.get().map(mapper).reduce(reducer); in assertValue()
290 s -> s.reduce(0, Integer::sum));
297 s -> s.reduce(Integer::sum));
304 s -> s.map(x -> x*2).reduce(0, Integer::sum));
307 s -> s.map(x -> x*2L).reduce(0L, Long::sum));
309 s -> s.map(x -> x*2).reduce(0, Integer::sum));
311 s -> s.map(x -> x * 2.0d).reduce(0.0d, Double::sum));
DRangeTest.java133 terminal(s -> s.reduce(0, Integer::sum)).exercise(); in tesIntRangeReduce()
139 terminal(s -> s.reduce(0, Integer::sum)).exercise(); in testIntInfiniteRangeLimit()
216 terminal(s -> s.reduce(0, Long::sum)).exercise(); in testLongRangeReduce()
222 terminal(s -> s.reduce(0, Long::sum)).exercise(); in testLongInfiniteRangeLimit()
DDoublePrimitiveOpsTests.java41 …double sum = Arrays.asList(1.0, 2.0, 3.0, 4.0, 5.0).stream().mapToDouble(i -> i).reduce(0.0, Doubl… in testUnBox()
DReduceByOpTest.java57 … assertEquals(entry.getValue(), data.stream().filter(e -> pEven.test(e) == key).reduce(0, rPlus)); in testOps()
DStreamSpliteratorTest.java251 s -> s.reduce(Integer::sum) in testSplitting()
345 s -> s.reduce(Integer::sum) in testIntSplitting()
438 s -> s.reduce(Long::sum) in testLongSplitting()
531 s -> s.reduce(Double::sum) in testDoubleSplitting()
DIntPrimitiveOpsTests.java79 int sum = l.stream().reduce(0, (a, b) -> a + b); in testBox()
DLongPrimitiveOpsTests.java79 long sum = l.stream().reduce(0L, (a, b) -> a + b); in testBox()
/libcore/ojluni/src/main/java/java/util/stream/
DDistinctOps.java58 <P_IN> Node<T> reduce(PipelineHelper<T> helper, Spliterator<P_IN> spliterator) { in makeRef()
77 return reduce(helper, spliterator); in makeRef()
112 return reduce(helper, spliterator).spliterator(); in makeRef()
DStream.java607 T reduce(T identity, BinaryOperator<T> accumulator); in reduce() method
647 Optional<T> reduce(BinaryOperator<T> accumulator); in reduce() method
696 <U> U reduce(U identity, in reduce() method
DIntPipeline.java431 return reduce(0, Integer::sum);
436 return reduce(Math::min);
441 return reduce(Math::max);
472 public final int reduce(int identity, IntBinaryOperator op) {
477 public final OptionalInt reduce(IntBinaryOperator op) {
DLongPipeline.java413 return reduce(0, Long::sum);
418 return reduce(Math::min);
423 return reduce(Math::max);
454 public final long reduce(long identity, LongBinaryOperator op) {
459 public final OptionalLong reduce(LongBinaryOperator op) {
DDoubleStream.java377 double reduce(double identity, DoubleBinaryOperator op); in reduce() method
414 OptionalDouble reduce(DoubleBinaryOperator op); in reduce() method
DReferencePipeline.java491 public final P_OUT reduce(final P_OUT identity, final BinaryOperator<P_OUT> accumulator) {
496 public final Optional<P_OUT> reduce(BinaryOperator<P_OUT> accumulator) {
501 …public final <R> R reduce(R identity, BiFunction<R, ? super P_OUT, R> accumulator, BinaryOperator<…
533 return reduce(BinaryOperator.maxBy(comparator));
538 return reduce(BinaryOperator.minBy(comparator));
DIntStream.java370 int reduce(int identity, IntBinaryOperator op); in reduce() method
407 OptionalInt reduce(IntBinaryOperator op); in reduce() method
DDoublePipeline.java420 return reduce(Math::min);
425 return reduce(Math::max);
475 public final double reduce(double identity, DoubleBinaryOperator op) {
480 public final OptionalDouble reduce(DoubleBinaryOperator op) {
DLongStream.java375 long reduce(long identity, LongBinaryOperator op); in reduce() method
412 OptionalLong reduce(LongBinaryOperator op); in reduce() method
/libcore/ojluni/src/main/java/sun/security/provider/certpath/
DBuilder.java348 permitted.reduce(excluded); in targetDistance()
/libcore/ojluni/src/main/java/sun/security/x509/
DGeneralSubtrees.java496 public void reduce(GeneralSubtrees excluded) { in reduce() method in GeneralSubtrees
DNameConstraintsExtension.java391 permitted.reduce(excluded); in merge()
/libcore/jsr166-tests/src/test/java/jsr166/
DConcurrentHashMap8Test.java845 … Long r = m.reduce(Long.MAX_VALUE, (Long x, Long y) -> Long.valueOf(x.longValue() + y.longValue()), in testMappedReduceSequentially()
877 r = m.reduce(1L, (Long x, Long y) -> Long.valueOf(x.longValue() + y.longValue()), in testMappedReduceInParallel()
/libcore/ojluni/annotations/sdk/nullability/java/util/concurrent/
DConcurrentHashMap.annotated.java136 …@libcore.util.Nullable public <U> U reduce(long parallelismThreshold, @libcore.util.NonNull java.u… in reduce() method in ConcurrentHashMap
/libcore/ojluni/src/main/java/java/util/concurrent/
DConcurrentHashMap.java3785 public <U> U reduce(long parallelismThreshold, in reduce() method in ConcurrentHashMap