Home
last modified time | relevance | path

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

123

/libcore/ojluni/annotations/flagged_api/java/util/stream/
DDoubleStream.annotated.java29 public interface DoubleStream extends java.util.stream.BaseStream<java.lang.Double,java.util.stream… interface
31 public java.util.stream.DoubleStream filter(java.util.function.DoublePredicate predicate); in filter()
33 public java.util.stream.DoubleStream map(java.util.function.DoubleUnaryOperator mapper); in map()
41 public java.util.stream.DoubleStream flatMap(java.util.function.DoubleFunction<? extends java.util.… in flatMap()
44 public default java.util.stream.DoubleStream mapMulti(java.util.stream.DoubleStream.DoubleMapMultiC… in mapMulti()
46 public java.util.stream.DoubleStream distinct(); in distinct()
48 public java.util.stream.DoubleStream sorted(); in sorted()
50 public java.util.stream.DoubleStream peek(java.util.function.DoubleConsumer action); in peek()
52 public java.util.stream.DoubleStream limit(long maxSize); in limit()
54 public java.util.stream.DoubleStream skip(long n); in skip()
[all …]
/libcore/ojluni/src/test/java/util/stream/
DTestDoubleSumAverage.java54 Supplier<DoubleStream> ds = () -> DoubleStream.iterate(0.0, e -> 0.0).limit(10); in testZeroAverageOfNonEmptyStream()
79 Supplier<DoubleStream> ds = () -> DoubleStream.iterate(base, e -> increment).limit(count); in testForCompenstation()
103 Map<Supplier<DoubleStream>, Double> testCases = new LinkedHashMap<>(); in testNonfiniteSum()
104 testCases.put(() -> DoubleStream.of(MAX_VALUE, MAX_VALUE), POSITIVE_INFINITY); in testNonfiniteSum()
105 testCases.put(() -> DoubleStream.of(-MAX_VALUE, -MAX_VALUE), NEGATIVE_INFINITY); in testNonfiniteSum()
107 testCases.put(() -> DoubleStream.of(1.0d, POSITIVE_INFINITY, 1.0d), POSITIVE_INFINITY); in testNonfiniteSum()
108 testCases.put(() -> DoubleStream.of(POSITIVE_INFINITY), POSITIVE_INFINITY); in testNonfiniteSum()
109 … testCases.put(() -> DoubleStream.of(POSITIVE_INFINITY, POSITIVE_INFINITY), POSITIVE_INFINITY); in testNonfiniteSum()
110 …testCases.put(() -> DoubleStream.of(POSITIVE_INFINITY, POSITIVE_INFINITY, 0.0), POSITIVE_INFINITY); in testNonfiniteSum()
112 testCases.put(() -> DoubleStream.of(1.0d, NEGATIVE_INFINITY, 1.0d), NEGATIVE_INFINITY); in testNonfiniteSum()
[all …]
/libcore/ojluni/src/main/java/java/util/stream/
DDoubleStream.java72 public interface DoubleStream extends BaseStream<Double, DoubleStream> { interface
87 DoubleStream filter(DoublePredicate predicate); in filter()
101 DoubleStream map(DoubleUnaryOperator mapper); in map()
164 DoubleStream flatMap(DoubleFunction<? extends DoubleStream> mapper); in flatMap()
194 default DoubleStream mapMulti(DoubleMapMultiConsumer mapper) { in mapMulti()
213 DoubleStream distinct(); in distinct()
225 DoubleStream sorted(); in sorted()
261 DoubleStream peek(DoubleConsumer action); in peek()
288 DoubleStream limit(long maxSize); in limit()
317 DoubleStream skip(long n); in skip()
[all …]
DDoublePipeline.java57 extends AbstractPipeline<E_IN, Double, DoubleStream>
58 implements DoubleStream {
212 public final DoubleStream map(DoubleUnaryOperator mapper) {
272 public final DoubleStream flatMap(DoubleFunction<? extends DoubleStream> mapper) {
293 try (DoubleStream result = mapper.apply(t)) {
321 public final DoubleStream mapMulti(DoubleMapMultiConsumer mapper) {
347 public DoubleStream unordered() {
360 public final DoubleStream filter(DoublePredicate predicate) {
384 public final DoubleStream peek(DoubleConsumer action) {
405 public final DoubleStream limit(long maxSize) {
[all …]
/libcore/ojluni/src/test/java/util/stream/bootlib/java/util/stream/
DDoubleStreamTestScenario.java48 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in STREAM_FOR_EACH_WITH_CLOSE()
49 DoubleStream s = m.apply(data.stream()); in STREAM_FOR_EACH_WITH_CLOSE()
60 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in STREAM_TO_ARRAY()
69 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in STREAM_ITERATOR()
78 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in STREAM_SPLITERATOR()
87 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in STREAM_SPLITERATOR_WITH_MIXED_TRAVERSE_AND_SPLIT()
95 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in STREAM_SPLITERATOR_FOREACH()
102 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in PAR_STREAM_SEQUENTIAL_FOR_EACH()
110 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in PAR_STREAM_FOR_EACH_ORDERED()
119 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in PAR_STREAM_SPLITERATOR()
[all …]
/libcore/ojluni/src/test/java/util/stream/testlib/org/openjdk/testlib/java/util/stream/
DDoubleStreamTestScenario.java52 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in STREAM_FOR_EACH_WITH_CLOSE()
53 DoubleStream s = m.apply(data.stream()); in STREAM_FOR_EACH_WITH_CLOSE()
64 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in STREAM_TO_ARRAY()
73 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in STREAM_ITERATOR()
82 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in STREAM_SPLITERATOR()
91 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in STREAM_SPLITERATOR_WITH_MIXED_TRAVERSE_AND_SPLIT()
99 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in STREAM_SPLITERATOR_FOREACH()
106 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in PAR_STREAM_SEQUENTIAL_FOR_EACH()
114 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in PAR_STREAM_FOR_EACH_ORDERED()
123 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in PAR_STREAM_SPLITERATOR()
[all …]
DDefaultMethodStreams.java166 public static DoubleStream delegateTo(DoubleStream s) { in delegateTo()
207 public DoubleStream mapToDouble(ToDoubleFunction<? super T> mapper) { in mapToDouble()
227 public DoubleStream flatMapToDouble(Function<? super T, ? extends DoubleStream> mapper) { in flatMapToDouble()
418 public DoubleStream mapToDouble(IntToDoubleFunction mapper) { in mapToDouble()
543 public DoubleStream asDoubleStream() { in asDoubleStream()
629 public DoubleStream mapToDouble(LongToDoubleFunction mapper) { in mapToDouble()
744 public DoubleStream asDoubleStream() { in asDoubleStream()
794 static final class DefaultMethodDoubleStream implements DoubleStream {
795 final DoubleStream s;
797 public DefaultMethodDoubleStream(DoubleStream s) { in DefaultMethodDoubleStream()
[all …]
/libcore/ojluni/src/test/java/util/stream/boottest/java/util/stream/
DStreamReuseTest.java357 … (DoubleStream s) -> s.mapToObj(i -> i), (DoubleStream s) -> s.mapToObj(i -> i), in testTwoStreams()
361 DoubleStream::distinct, (DoubleStream s) -> s.mapToObj(i -> i), in testTwoStreams()
365 (DoubleStream s) -> s.mapToObj(i -> i), DoubleStream::distinct, in testTwoStreams()
369 DoubleStream::distinct, DoubleStream::distinct, in testTwoStreams()
377 DoubleStream::sum, DoubleStream::sum, in testTwoTerminals()
385 DoubleStream::sum, (DoubleStream s) -> s.mapToObj(i -> i), in testTerminalStream()
389 (DoubleStream s) -> s.mapToObj(i -> i), DoubleStream::sum, in testTerminalStream()
393 DoubleStream::sum, DoubleStream::distinct, in testTerminalStream()
397 DoubleStream::distinct, DoubleStream::sum, in testTerminalStream()
405 DoubleStream::iterator, DoubleStream::iterator, in testTwoIterators()
[all …]
/libcore/ojluni/src/test/java/util/DoubleStreamSums/
DCompensatedSums.java42 import java.util.stream.DoubleStream;
81 naive += square(DoubleStream.of(rand).reduce((x, y) -> x+y).getAsDouble() - sum[0]); in testCompensatedSums()
84 jdkSequentialStreamError += square(DoubleStream.of(rand).sum() - sum[0]); in testCompensatedSums()
86 …goodSequentialStreamError += square(computeFinalSum(DoubleStream.of(rand).collect(doubleSupplier,o… in testCompensatedSums()
89 jdkParallelStreamError += square(DoubleStream.of(rand).parallel().sum() - sum[0]); in testCompensatedSums()
92 …goodParallelStreamError += square(computeFinalSum(DoubleStream.of(rand).parallel().collect(doubleS… in testCompensatedSums()
95 …badParallelStreamError += square(computeFinalSum(DoubleStream.of(rand).parallel().collect(doubleSu… in testCompensatedSums()
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DDoublePrimitiveOpsTests.java31 import java.util.stream.DoubleStream;
56 assertFalse(DoubleStream.of(1, 10).boxed().spliterator() in testFlags()
75 double[] content = DoubleStream.generate(() -> r.nextDouble()).limit(10).toArray(); in testSort()
101 assertEquals(DoubleStream.of(data).sorted().distinct().toArray(), expected); in testSortDistinct()
102 assertEquals(DoubleStream.of(data).parallel().sorted().distinct().toArray(), expected); in testSortDistinct()
109 double[] content = DoubleStream.generate(() -> r.nextDouble()).limit(10).toArray(); in testSortSort()
128 double[] actual = DoubleStream.iterate(1.0, i -> i + 1.0).limit(9).toArray(); in testLimit()
DConcatOpTest.java36 import java.util.stream.DoubleStream;
54 … s -> DoubleStream.concat(s, data.stream().mapToDouble(Integer::doubleValue))); in testOps()
112 assertSized(DoubleStream.concat( in testDoubleSize()
116 assertUnsized(DoubleStream.concat( in testDoubleSize()
120 assertUnsized(DoubleStream.concat( in testDoubleSize()
122 DoubleStream.iterate(0, i -> i + 1))); in testDoubleSize()
124 assertUnsized(DoubleStream.concat( in testDoubleSize()
125 DoubleStream.iterate(0, i -> i + 1), in testDoubleSize()
DCountTest.java41 import java.util.stream.DoubleStream;
159 terminal(DoubleStream::count). in testOps()
164 terminal(s -> s.skip(1), DoubleStream::count). in testOps()
169 terminal(s -> s.filter(e -> true), DoubleStream::count). in testOps()
175 terminal(DoubleStream::distinct, DoubleStream::count). in testOps()
179 terminal(s -> s.unordered().distinct(), DoubleStream::count). in testOps()
192 checkDoubleStreamDoesNotConsumeElements(() -> DoubleStream.of(1, 2, 3, 4), 4); in testNoEvaluationForSizedStream()
193 …checkDoubleStreamDoesNotConsumeElements(() -> DoubleStream.of(1, 2, 3, 4).skip(1).limit(2).skip(1)… in testNoEvaluationForSizedStream()
223 …private void checkDoubleStreamDoesNotConsumeElements(Supplier<DoubleStream> supplier, long expecte… in checkDoubleStreamDoesNotConsumeElements()
DIterateTest.java37 import java.util.stream.DoubleStream;
76 …Factory.ofDoubleSupplier("double.empty", () -> DoubleStream.iterate(1.0, x -> x < 0, x -> x + 1))}, in makeIterateStreamsTestData()
78 … Factory.ofDoubleSupplier("double.one", () -> DoubleStream.iterate(1.0, x -> x < 2, x -> x + 1))}, in makeIterateStreamsTestData()
80 … Factory.ofDoubleSupplier("double.ten", () -> DoubleStream.iterate(1.0, x -> x <= 10, x -> x + 1))} in makeIterateStreamsTestData()
98 checkNPE(() -> DoubleStream.iterate(0, null, x -> x + 1)); in testNPE()
99 checkNPE(() -> DoubleStream.iterate(0, x -> x < 10, null)); in testNPE()
DStreamSpliteratorTest.java44 import java.util.stream.DoubleStream;
532 List<Consumer<DoubleStream>> terminalOps = Arrays.asList( in testDoubleSplitting()
538 List<UnaryOperator<DoubleStream>> intermediateOps = Arrays.asList( in testDoubleSplitting()
545 Consumer<DoubleStream> terminalOp = terminalOps.get(i); in testDoubleSplitting()
548 UnaryOperator<DoubleStream> intermediateOp = intermediateOps.get(j); in testDoubleSplitting()
556 DoubleStream s = StreamSupport.doubleStream(psp, true); in testDoubleSplitting()
576 for (Function<DoubleStream, DoubleStream> f : doubleStreamFunctions()) {
579 DoubleStream out = f.apply(in);
586 DoubleStream out = f.apply(in);
595 for (Function<DoubleStream, DoubleStream> f : doubleStreamFunctions()) { in testDoubleSpliterators()
[all …]
DStreamBuilderTest.java37 import java.util.stream.DoubleStream;
273 TestData.OfDouble data = TestData.Factory.ofDoubleSupplier("{1}", () -> DoubleStream.of(1)); in testDoubleSingleton()
288 DoubleStream.Builder sb = DoubleStream.builder(); in testDoubleAfterBuilding()
301 DoubleStream.Builder sb = DoubleStream.builder(); in testDoubleStreamBuilder()
307 DoubleStream.Builder sb = DoubleStream.builder(); in testDoubleStreamBuilder()
309 DoubleStream.Builder _sb = sb.add(i); in testDoubleStreamBuilder()
316 private void testDoubleStreamBuilder(int size, Function<Integer, DoubleStream> supplier) { in testDoubleStreamBuilder()
DFlatMapOpTest.java39 import java.util.stream.DoubleStream;
61 checkNPE(() -> DoubleStream.of(1).flatMap(null)); in testNullMapper()
101 … s.get().flatMapToDouble(i -> DoubleStream.of(i, i).onClose(onClose::getAndIncrement)).count(); in testClose()
130 DoubleStream.of(1, 2).peek(e -> before.getAndIncrement()). in testDoubleClose()
131 flatMap(i -> DoubleStream.of(i, i).onClose(onClose::getAndIncrement)).count(); in testDoubleClose()
244 Collection<Double> result = exerciseOps(data, s -> s.flatMap(DoubleStream::of)); in testDoubleOps()
248 result = exerciseOps(data, s -> s.boxed().flatMapToDouble(DoubleStream::of)); in testDoubleOps()
252 result = exerciseOps(data, s -> DoubleStream.empty()); in testDoubleOps()
265 DoubleStream.of(0).flatMap(i -> IntStream.range(0, 100).asDoubleStream()). in testDoubleOpsShortCircuit()
DInfiniteStreamWithLimitOpTest.java45 import java.util.stream.DoubleStream;
112 (UnaryOperator<DoubleStream>) s -> s.limit(SKIP_LIMIT_SIZE)}); in doubleSliceFunctionsDataProvider()
114 (UnaryOperator<DoubleStream>) s -> s.skip(SKIP_LIMIT_SIZE).limit(SKIP_LIMIT_SIZE)}); in doubleSliceFunctionsDataProvider()
216 public void testDoubleSubsizedWithRange(String description, UnaryOperator<DoubleStream> fs) {
263 public void testDoubleUnorderedFinite(String description, UnaryOperator<DoubleStream> fs) {
346 …oid testDoubleUnorderedSizedNotSubsizedFinite(String description, UnaryOperator<DoubleStream> fs) {
394 public void testDoubleUnorderedGenerator(String description, UnaryOperator<DoubleStream> fs) {
397 "[1.0, 1.0, ...]", () -> DoubleStream.generate(() -> 1.0));
447 public void testDoubleUnorderedIteration(String description, UnaryOperator<DoubleStream> fs) {
450 "[1.0, 2.0, 3.0, ...]", () -> DoubleStream.iterate(1, i -> i + 1));
DToArrayOpTest.java41 import java.util.stream.DoubleStream;
381 … double[] doubles = exerciseTerminalOps(data, s -> s.sorted(), (DoubleStream s) -> s.toArray());
404 private List<Function<DoubleStream, DoubleStream>> doubleUniqueAndSortedPermutations =
414 for (Function<DoubleStream, DoubleStream> f : doubleUniqueAndSortedPermutations) {
419 private List<Function<DoubleStream, DoubleStream>> doubleStatefulOpPermutations =
428 for (Function<DoubleStream, DoubleStream> f : doubleStatefulOpPermutations) {
/libcore/ojluni/src/main/java/java/util/
DOptionalDouble.java30 import java.util.stream.DoubleStream;
205 public DoubleStream stream() { in stream()
207 return DoubleStream.of(value); in stream()
209 return DoubleStream.empty(); in stream()
DSplittableRandom.java31 import java.util.stream.DoubleStream;
524 public DoubleStream doubles(long streamSize) { in doubles()
539 public DoubleStream doubles() { in doubles()
559 …public DoubleStream doubles(long streamSize, double randomNumberOrigin, double randomNumberBound) { in doubles()
579 public DoubleStream doubles(double randomNumberOrigin, double randomNumberBound) { in doubles()
DRandom.java35 import java.util.stream.DoubleStream;
924 public DoubleStream doubles(long streamSize) { in doubles()
943 public DoubleStream doubles() { in doubles()
975 …public DoubleStream doubles(long streamSize, double randomNumberOrigin, double randomNumberBound) { in doubles()
1007 public DoubleStream doubles(double randomNumberOrigin, double randomNumberBound) { in doubles()
/libcore/ojluni/annotations/flagged_api/java/util/concurrent/
DThreadLocalRandom.annotated.java97 public java.util.stream.DoubleStream doubles(long streamSize) { throw new RuntimeException("Stub!")… in doubles()
99 public java.util.stream.DoubleStream doubles() { throw new RuntimeException("Stub!"); } in doubles()
101 public java.util.stream.DoubleStream doubles(long streamSize, double randomNumberOrigin, double ran… in doubles()
103 public java.util.stream.DoubleStream doubles(double randomNumberOrigin, double randomNumberBound) {… in doubles()
/libcore/ojluni/annotations/flagged_api/java/util/
DSplittableRandom.annotated.java74 public java.util.stream.DoubleStream doubles(long streamSize) { throw new RuntimeException("Stub!")… in doubles()
76 public java.util.stream.DoubleStream doubles() { throw new RuntimeException("Stub!"); } in doubles()
78 public java.util.stream.DoubleStream doubles(long streamSize, double randomNumberOrigin, double ran… in doubles()
80 public java.util.stream.DoubleStream doubles(double randomNumberOrigin, double randomNumberBound) {… in doubles()
/libcore/ojluni/src/main/java/java/util/random/
DRandomGenerator.java35 import java.util.stream.DoubleStream;
173 default DoubleStream doubles() { in doubles()
174 return DoubleStream.generate(this::nextDouble).sequential(); in doubles()
199 default DoubleStream doubles(double randomNumberOrigin, double randomNumberBound) { in doubles()
202 …return DoubleStream.generate(() -> nextDouble(randomNumberOrigin, randomNumberBound)).sequential(); in doubles()
219 default DoubleStream doubles(long streamSize) { in doubles()
246 default DoubleStream doubles(long streamSize, double randomNumberOrigin, in doubles()
/libcore/ojluni/src/test/java/util/Random/
DRandomTestCoverage.java36 import java.util.stream.DoubleStream;
86 DoubleStream doubleStream1 = rng.doubles(); in coverRandomGenerator()
87 DoubleStream doubleStream2 = rng.doubles(0.5, 1.0); in coverRandomGenerator()
88 DoubleStream doubleStream3 = rng.doubles(5); in coverRandomGenerator()
89 DoubleStream doubleStream4 = rng.doubles(5, 0.5, 1.0); in coverRandomGenerator()

123