java.util.stream.DoubleStream#concat ( )源码实例Demo

下面列出了java.util.stream.DoubleStream#concat ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: latexdraw   文件: DoubleSupplier.java
@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());
}
 
源代码2 项目: dragonwell8_jdk   文件: ConcatTest.java
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());
}
 
源代码3 项目: TencentKona-8   文件: ConcatTest.java
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());
}
 
源代码4 项目: jdk8u60   文件: ConcatTest.java
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());
}
 
源代码5 项目: openjdk-jdk8u   文件: ConcatTest.java
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());
}
 
源代码6 项目: openjdk-jdk8u-backup   文件: ConcatTest.java
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());
}
 
源代码7 项目: openjdk-jdk9   文件: ConcatTest.java
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());
}
 
源代码8 项目: jdk8u-jdk   文件: ConcatTest.java
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());
}
 
源代码9 项目: hottub   文件: ConcatTest.java
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());
}
 
源代码10 项目: openjdk-8-source   文件: ConcatTest.java
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());
}
 
源代码11 项目: openjdk-8   文件: ConcatTest.java
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());
}
 
源代码12 项目: jdk8u_jdk   文件: ConcatTest.java
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());
}
 
源代码13 项目: jdk8u-jdk   文件: ConcatTest.java
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());
}
 
源代码14 项目: jdk8u-dev-jdk   文件: ConcatTest.java
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());
}
 
@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);
}
 
源代码16 项目: streamex   文件: DoubleStreamEx.java
/**
 * 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);
}
 
源代码17 项目: streamex   文件: DoubleStreamEx.java
/**
 * 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));
}
 
源代码18 项目: streamex   文件: DoubleStreamEx.java
/**
 * 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);
}
 
源代码19 项目: streamex   文件: DoubleStreamEx.java
/**
 * 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));
}