Java Code Examples for java.util.stream.DoubleStream#concat()
The following examples show how to use
java.util.stream.DoubleStream#concat() .
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: DoubleSupplier.java From latexdraw with GNU General Public License v3.0 | 6 votes |
@Override public List<PotentialAssignment> getValueSources(final ParameterSignature sig) { final DoubleData doubledata = sig.getAnnotation(DoubleData.class); DoubleStream stream = Arrays.stream(doubledata.vals()); if(doubledata.angle()) { stream = DoubleStream.of(0d, Math.PI / 2d, Math.PI, 3d * Math.PI / 2d, 2d * Math.PI, -Math.PI / 2d, -Math.PI, -3d * Math.PI / 2d, -2d * Math.PI, 1.234, -1.234, 3d * Math.PI, -3d * Math.PI); } if(doubledata.bads()) { stream = DoubleStream.concat(stream, DoubleStream.of(Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY)); } return stream.mapToObj(i -> PotentialAssignment.forValue("", i)).collect(Collectors.toList()); }
Example 2
Source File: ConcatTest.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private void assertDoubleConcat(Stream<Integer> s1, Stream<Integer> s2, boolean parallel, boolean ordered) { DoubleStream result = DoubleStream.concat(s1.mapToDouble(Integer::doubleValue), s2.mapToDouble(Integer::doubleValue)); assertEquals(result.isParallel(), parallel); assertConcatContent(result.spliterator(), ordered, expected.stream().mapToDouble(Integer::doubleValue).spliterator()); }
Example 3
Source File: ConcatTest.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
private void assertDoubleConcat(Stream<Integer> s1, Stream<Integer> s2, boolean parallel, boolean ordered) { DoubleStream result = DoubleStream.concat(s1.mapToDouble(Integer::doubleValue), s2.mapToDouble(Integer::doubleValue)); assertEquals(result.isParallel(), parallel); assertConcatContent(result.spliterator(), ordered, expected.stream().mapToDouble(Integer::doubleValue).spliterator()); }
Example 4
Source File: ConcatTest.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
private void assertDoubleConcat(Stream<Integer> s1, Stream<Integer> s2, boolean parallel, boolean ordered) { DoubleStream result = DoubleStream.concat(s1.mapToDouble(Integer::doubleValue), s2.mapToDouble(Integer::doubleValue)); assertEquals(result.isParallel(), parallel); assertConcatContent(result.spliterator(), ordered, expected.stream().mapToDouble(Integer::doubleValue).spliterator()); }
Example 5
Source File: ConcatTest.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
private void assertDoubleConcat(Stream<Integer> s1, Stream<Integer> s2, boolean parallel, boolean ordered) { DoubleStream result = DoubleStream.concat(s1.mapToDouble(Integer::doubleValue), s2.mapToDouble(Integer::doubleValue)); assertEquals(result.isParallel(), parallel); assertConcatContent(result.spliterator(), ordered, expected.stream().mapToDouble(Integer::doubleValue).spliterator()); }
Example 6
Source File: ConcatTest.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private void assertDoubleConcat(Stream<Integer> s1, Stream<Integer> s2, boolean parallel, boolean ordered) { DoubleStream result = DoubleStream.concat(s1.mapToDouble(Integer::doubleValue), s2.mapToDouble(Integer::doubleValue)); assertEquals(result.isParallel(), parallel); assertConcatContent(result.spliterator(), ordered, expected.stream().mapToDouble(Integer::doubleValue).spliterator()); }
Example 7
Source File: ConcatTest.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private void assertDoubleConcat(Stream<Integer> s1, Stream<Integer> s2, boolean parallel, boolean ordered) { DoubleStream result = DoubleStream.concat(s1.mapToDouble(Integer::doubleValue), s2.mapToDouble(Integer::doubleValue)); assertEquals(result.isParallel(), parallel); assertConcatContent(result.spliterator(), ordered, expected.stream().mapToDouble(Integer::doubleValue).spliterator()); }
Example 8
Source File: ConcatTest.java From hottub with GNU General Public License v2.0 | 5 votes |
private void assertDoubleConcat(Stream<Integer> s1, Stream<Integer> s2, boolean parallel, boolean ordered) { DoubleStream result = DoubleStream.concat(s1.mapToDouble(Integer::doubleValue), s2.mapToDouble(Integer::doubleValue)); assertEquals(result.isParallel(), parallel); assertConcatContent(result.spliterator(), ordered, expected.stream().mapToDouble(Integer::doubleValue).spliterator()); }
Example 9
Source File: ConcatTest.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
private void assertDoubleConcat(Stream<Integer> s1, Stream<Integer> s2, boolean parallel, boolean ordered) { DoubleStream result = DoubleStream.concat(s1.mapToDouble(Integer::doubleValue), s2.mapToDouble(Integer::doubleValue)); assertEquals(result.isParallel(), parallel); assertConcatContent(result.spliterator(), ordered, expected.stream().mapToDouble(Integer::doubleValue).spliterator()); }
Example 10
Source File: ConcatTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private void assertDoubleConcat(Stream<Integer> s1, Stream<Integer> s2, boolean parallel, boolean ordered) { DoubleStream result = DoubleStream.concat(s1.mapToDouble(Integer::doubleValue), s2.mapToDouble(Integer::doubleValue)); assertEquals(result.isParallel(), parallel); assertConcatContent(result.spliterator(), ordered, expected.stream().mapToDouble(Integer::doubleValue).spliterator()); }
Example 11
Source File: ConcatTest.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private void assertDoubleConcat(Stream<Integer> s1, Stream<Integer> s2, boolean parallel, boolean ordered) { DoubleStream result = DoubleStream.concat(s1.mapToDouble(Integer::doubleValue), s2.mapToDouble(Integer::doubleValue)); assertEquals(result.isParallel(), parallel); assertConcatContent(result.spliterator(), ordered, expected.stream().mapToDouble(Integer::doubleValue).spliterator()); }
Example 12
Source File: ConcatTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private void assertDoubleConcat(Stream<Integer> s1, Stream<Integer> s2, boolean parallel, boolean ordered) { DoubleStream result = DoubleStream.concat(s1.mapToDouble(Integer::doubleValue), s2.mapToDouble(Integer::doubleValue)); assertEquals(result.isParallel(), parallel); assertConcatContent(result.spliterator(), ordered, expected.stream().mapToDouble(Integer::doubleValue).spliterator()); }
Example 13
Source File: ConcatTest.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
private void assertDoubleConcat(Stream<Integer> s1, Stream<Integer> s2, boolean parallel, boolean ordered) { DoubleStream result = DoubleStream.concat(s1.mapToDouble(Integer::doubleValue), s2.mapToDouble(Integer::doubleValue)); assertEquals(result.isParallel(), parallel); assertConcatContent(result.spliterator(), ordered, expected.stream().mapToDouble(Integer::doubleValue).spliterator()); }
Example 14
Source File: ConcatTest.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
private void assertDoubleConcat(Stream<Integer> s1, Stream<Integer> s2, boolean parallel, boolean ordered) { DoubleStream result = DoubleStream.concat(s1.mapToDouble(Integer::doubleValue), s2.mapToDouble(Integer::doubleValue)); assertEquals(result.isParallel(), parallel); assertConcatContent(result.spliterator(), ordered, expected.stream().mapToDouble(Integer::doubleValue).spliterator()); }
Example 15
Source File: DoubleStreamExample.java From levelup-java-examples with Apache License 2.0 | 3 votes |
@Test public void doublestream_concat() { DoubleStream first = DoubleStream.builder().add(10).build(); DoubleStream second = DoubleStream.builder().add(10).build(); DoubleStream third = DoubleStream.concat(first, second); assertEquals(20, third.sum(), 0); }
Example 16
Source File: DoubleStreamEx.java From streamex with Apache License 2.0 | 2 votes |
/** * Returns a new {@code DoubleStreamEx} which is a concatenation of this * stream and the stream containing supplied values * * <p> * This is a <a href="package-summary.html#StreamOps">quasi-intermediate * operation</a>. * * @param values the values to append to the stream * @return the new stream */ public DoubleStreamEx append(double... values) { if (values.length == 0) return this; return new DoubleStreamEx(DoubleStream.concat(stream(), DoubleStream.of(values)), context); }
Example 17
Source File: DoubleStreamEx.java From streamex with Apache License 2.0 | 2 votes |
/** * Creates a lazily concatenated stream whose elements are all the elements * of this stream followed by all the elements of the other stream. The * resulting stream is ordered if both of the input streams are ordered, and * parallel if either of the input streams is parallel. When the resulting * stream is closed, the close handlers for both input streams are invoked. * * @param other the other stream * @return this stream appended by the other stream * @see DoubleStream#concat(DoubleStream, DoubleStream) */ public DoubleStreamEx append(DoubleStream other) { return new DoubleStreamEx(DoubleStream.concat(stream(), other), context.combine(other)); }
Example 18
Source File: DoubleStreamEx.java From streamex with Apache License 2.0 | 2 votes |
/** * Returns a new {@code DoubleStreamEx} which is a concatenation of the * stream containing supplied values and this stream * * <p> * This is a <a href="package-summary.html#StreamOps">quasi-intermediate * operation</a>. * * @param values the values to prepend to the stream * @return the new stream */ public DoubleStreamEx prepend(double... values) { if (values.length == 0) return this; return new DoubleStreamEx(DoubleStream.concat(DoubleStream.of(values), stream()), context); }
Example 19
Source File: DoubleStreamEx.java From streamex with Apache License 2.0 | 2 votes |
/** * Creates a lazily concatenated stream whose elements are all the elements * of the other stream followed by all the elements of this stream. The * resulting stream is ordered if both of the input streams are ordered, and * parallel if either of the input streams is parallel. When the resulting * stream is closed, the close handlers for both input streams are invoked. * * @param other the other stream * @return this stream prepended by the other stream * @see DoubleStream#concat(DoubleStream, DoubleStream) */ public DoubleStreamEx prepend(DoubleStream other) { return new DoubleStreamEx(DoubleStream.concat(other, stream()), context.combine(other)); }