Java Code Examples for java.util.stream.DoubleStream#builder()
The following examples show how to use
java.util.stream.DoubleStream#builder() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StreamBuilderTest.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "sizes") public void testDoubleAfterBuilding(int size) { DoubleStream.Builder sb = DoubleStream.builder(); IntStream.range(0, size).asDoubleStream().forEach(sb); sb.build(); checkISE(() -> sb.accept(1)); checkISE(() -> sb.add(1)); checkISE(() -> sb.build()); }
Example 2
Source File: StreamBuilderTest.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "sizes") public void testDoubleAfterBuilding(int size) { DoubleStream.Builder sb = DoubleStream.builder(); IntStream.range(0, size).asDoubleStream().forEach(sb); sb.build(); checkISE(() -> sb.accept(1)); checkISE(() -> sb.add(1)); checkISE(() -> sb.build()); }
Example 3
Source File: StreamBuilderTest.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "sizes") public void testDoubleAfterBuilding(int size) { DoubleStream.Builder sb = DoubleStream.builder(); IntStream.range(0, size).asDoubleStream().forEach(sb); sb.build(); checkISE(() -> sb.accept(1)); checkISE(() -> sb.add(1)); checkISE(() -> sb.build()); }
Example 4
Source File: DoubleStreamExTest.java From streamex with Apache License 2.0 | 5 votes |
@Test public void testDropWhile() { assertArrayEquals(new double[] { 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, LongStreamEx.range(100).asDoubleStream() .dropWhile(i -> i % 10 < 5).limit(10).toArray(), 0.0); assertEquals(100, LongStreamEx.range(100).asDoubleStream().sorted().dropWhile(i -> i % 10 < 0).count()); assertEquals(0, LongStreamEx.range(100).asDoubleStream().dropWhile(i -> i % 10 < 10).count()); assertEquals(OptionalDouble.of(0), LongStreamEx.range(100).asDoubleStream().dropWhile(i -> i % 10 < 0).findFirst()); assertEquals(OptionalDouble.empty(), LongStreamEx.range(100).asDoubleStream().dropWhile(i -> i % 10 < 10).findFirst()); java.util.Spliterator.OfDouble spltr = LongStreamEx.range(100).asDoubleStream().dropWhile(i -> i % 10 < 1).spliterator(); assertTrue(spltr.tryAdvance((double x) -> assertEquals(1, x, 0.0))); Builder builder = DoubleStream.builder(); spltr.forEachRemaining(builder); assertArrayEquals(LongStreamEx.range(2, 100).asDoubleStream().toArray(), builder.build().toArray(), 0.0); }
Example 5
Source File: EmitterSpliterator.java From streamex with Apache License 2.0 | 5 votes |
@Override public void accept(double t) { if ((vals += vals < 3 ? 1 : 0) == 2) { cons = DoubleStream.builder(); } cons.accept(t); }
Example 6
Source File: RollingOfDoubleSpliterator.java From streams-utils with Apache License 2.0 | 5 votes |
private DoubleStream buildSubstream() { DoubleStream.Builder subBuilder = DoubleStream.builder() ; for (int i = 0 ; i < grouping ; i++) { subBuilder.add(buffer[(i + bufferReadIndex.get()) % buffer.length]) ; } bufferReadIndex.incrementAndGet() ; return subBuilder.build() ; }
Example 7
Source File: StreamBuilderTest.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "sizes") public void testDoubleAfterBuilding(int size) { DoubleStream.Builder sb = DoubleStream.builder(); IntStream.range(0, size).asDoubleStream().forEach(sb); sb.build(); checkISE(() -> sb.accept(1)); checkISE(() -> sb.add(1)); checkISE(() -> sb.build()); }
Example 8
Source File: StreamBuilderTest.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "sizes") public void testDoubleAfterBuilding(int size) { DoubleStream.Builder sb = DoubleStream.builder(); IntStream.range(0, size).asDoubleStream().forEach(sb); sb.build(); checkISE(() -> sb.accept(1)); checkISE(() -> sb.add(1)); checkISE(() -> sb.build()); }
Example 9
Source File: StreamBuilderTest.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "sizes") public void testDoubleAfterBuilding(int size) { DoubleStream.Builder sb = DoubleStream.builder(); IntStream.range(0, size).asDoubleStream().forEach(sb); sb.build(); checkISE(() -> sb.accept(1)); checkISE(() -> sb.add(1)); checkISE(() -> sb.build()); }
Example 10
Source File: StreamBuilderTest.java From hottub with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "sizes") public void testDoubleAfterBuilding(int size) { DoubleStream.Builder sb = DoubleStream.builder(); IntStream.range(0, size).asDoubleStream().forEach(sb); sb.build(); checkISE(() -> sb.accept(1)); checkISE(() -> sb.add(1)); checkISE(() -> sb.build()); }
Example 11
Source File: StreamBuilderTest.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "sizes") public void testDoubleAfterBuilding(int size) { DoubleStream.Builder sb = DoubleStream.builder(); IntStream.range(0, size).asDoubleStream().forEach(sb); sb.build(); checkISE(() -> sb.accept(1)); checkISE(() -> sb.add(1)); checkISE(() -> sb.build()); }
Example 12
Source File: StreamBuilderTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "sizes") public void testDoubleAfterBuilding(int size) { DoubleStream.Builder sb = DoubleStream.builder(); IntStream.range(0, size).asDoubleStream().forEach(sb); sb.build(); checkISE(() -> sb.accept(1)); checkISE(() -> sb.add(1)); checkISE(() -> sb.build()); }
Example 13
Source File: StreamBuilderTest.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "sizes") public void testDoubleAfterBuilding(int size) { DoubleStream.Builder sb = DoubleStream.builder(); IntStream.range(0, size).asDoubleStream().forEach(sb); sb.build(); checkISE(() -> sb.accept(1)); checkISE(() -> sb.add(1)); checkISE(() -> sb.build()); }
Example 14
Source File: StreamBuilderTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "sizes") public void testDoubleAfterBuilding(int size) { DoubleStream.Builder sb = DoubleStream.builder(); IntStream.range(0, size).asDoubleStream().forEach(sb); sb.build(); checkISE(() -> sb.accept(1)); checkISE(() -> sb.add(1)); checkISE(() -> sb.build()); }
Example 15
Source File: StreamBuilderTest.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "sizes") public void testDoubleAfterBuilding(int size) { DoubleStream.Builder sb = DoubleStream.builder(); IntStream.range(0, size).asDoubleStream().forEach(sb); sb.build(); checkISE(() -> sb.accept(1)); checkISE(() -> sb.add(1)); checkISE(() -> sb.build()); }
Example 16
Source File: StreamBuilderTest.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "sizes") public void testDoubleAfterBuilding(int size) { DoubleStream.Builder sb = DoubleStream.builder(); IntStream.range(0, size).asDoubleStream().forEach(sb); sb.build(); checkISE(() -> sb.accept(1)); checkISE(() -> sb.add(1)); checkISE(() -> sb.build()); }
Example 17
Source File: DoubleColumn.java From paleo with Apache License 2.0 | 4 votes |
private Builder(DoubleColumnId id) { this.id = id; this.valueBuilder = DoubleStream.builder(); this.metaDataBuilder = new MetaDataBuilder(); }