java.util.stream.LongStream.concat()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(113)

本文整理了Java中java.util.stream.LongStream.concat()方法的一些代码示例,展示了LongStream.concat()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LongStream.concat()方法的具体详情如下:
包路径:java.util.stream.LongStream
类名称:LongStream
方法名:concat

LongStream.concat介绍

暂无

代码示例

代码示例来源:origin: aol/cyclops

@Deprecated //moved to cyclops.companion.Functions
public static Function<? super ReactiveSeq<Long>, ? extends ReactiveSeq<Long>> concatLongs( ReactiveSeq<Long> b){
  return a->fromSpliterator(LongStream.concat(a.mapToLong(i->i),b.mapToLong(i->i)).spliterator());
}

代码示例来源:origin: aol/cyclops

public static Function<? super ReactiveSeq<Long>, ? extends ReactiveSeq<Long>> concatLongs( ReactiveSeq<Long> b){
  return a->ReactiveSeq.fromSpliterator(LongStream.concat(a.mapToLong(i->i),b.mapToLong(i->i)).spliterator());
}

代码示例来源:origin: org.qcri.rheem/rheem-core

nullCardinalityReplacement,
(inputCards, outputCards) ->
    lowerLoadPerCardinalityUnit * LongStream.concat(
        Arrays.stream(inputCards),
        Arrays.stream(outputCards)
    ).sum(),
(inputCards, outputCards) ->
    upperLoadPerCardinalityUnit * LongStream.concat(
        Arrays.stream(inputCards),
        Arrays.stream(outputCards)

代码示例来源:origin: org.qcri.rheem/rheem-core

/**
 * Create a {@link LoadEstimator} that accounts a given load for each input and output element. Missing
 * {@link CardinalityEstimate}s are interpreted as a cardinality of {@code 0}.
 *
 * @param operator                   an {@link ExecutionOperator} being addressed by the new instance
 * @param loadPerCardinalityUnit     expected load units per input and output data quantum
 * @param confidence                 confidence in the new instance
 * @param nullCardinalityReplacement replacement for {@code null}s as {@link CardinalityEstimate}s
 */
public static LoadEstimator createIOLinearEstimator(ExecutionOperator operator,
                          long loadPerCardinalityUnit,
                          double confidence,
                          CardinalityEstimate nullCardinalityReplacement) {
  return new DefaultLoadEstimator(
      operator == null ? UNSPECIFIED_NUM_SLOTS : operator.getNumInputs(),
      operator == null ? UNSPECIFIED_NUM_SLOTS : operator.getNumOutputs(),
      confidence,
      nullCardinalityReplacement,
      (inputCards, outputCards) ->
          loadPerCardinalityUnit * LongStream.concat(
              Arrays.stream(inputCards),
              Arrays.stream(outputCards)
          ).sum()
  );
}

代码示例来源:origin: com.oath.cyclops/cyclops

@Deprecated //moved to cyclops.companion.Functions
public static Function<? super ReactiveSeq<Long>, ? extends ReactiveSeq<Long>> concatLongs( ReactiveSeq<Long> b){
  return a->fromSpliterator(LongStream.concat(a.mapToLong(i->i),b.mapToLong(i->i)).spliterator());
}

代码示例来源:origin: one.util/streamex

/**
 * 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 LongStream#concat(LongStream, LongStream)
 */
public LongStreamEx append(LongStream other) {
  return new LongStreamEx(LongStream.concat(stream(), other), context.combine(other));
}

代码示例来源:origin: one.util/streamex

/**
 * Returns a new {@code LongStreamEx} 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 LongStreamEx prepend(long... values) {
  if (values.length == 0)
    return this;
  return new LongStreamEx(LongStream.concat(LongStream.of(values), stream()), context);
}

代码示例来源:origin: one.util/streamex

/**
 * 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 LongStream#concat(LongStream, LongStream)
 */
public LongStreamEx prepend(LongStream other) {
  return new LongStreamEx(LongStream.concat(other, stream()), context.combine(other));
}

代码示例来源:origin: one.util/streamex

/**
 * Returns a new {@code LongStreamEx} 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 LongStreamEx append(long... values) {
  if (values.length == 0)
    return this;
  return new LongStreamEx(LongStream.concat(stream(), LongStream.of(values)), context);
}

代码示例来源:origin: com.aol.simplereact/cyclops-react

public static Function<? super ReactiveSeq<Long>, ? extends ReactiveSeq<Long>> concatLongs( ReactiveSeq<Long> b){
  return a->fromSpliterator(LongStream.concat(a.mapToLong(i->i),b.mapToLong(i->i)).spliterator());
}

代码示例来源:origin: com.oath.cyclops/cyclops

public static Function<? super ReactiveSeq<Long>, ? extends ReactiveSeq<Long>> concatLongs( ReactiveSeq<Long> b){
  return a->ReactiveSeq.fromSpliterator(LongStream.concat(a.mapToLong(i->i),b.mapToLong(i->i)).spliterator());
}

代码示例来源:origin: sc.fiji/bigdataviewer-vistools

final long[] min = LongStream.concat( Arrays.stream( Intervals.minAsLongArray( interval ) ), LongStream.of( 0 ) ).toArray();
final long[] max = LongStream.concat( Arrays.stream( Intervals.maxAsLongArray( interval ) ), LongStream.of( 0 ) ).toArray();
interval = new FinalInterval( min, max );
for ( int i = 0; i < sourceStacks.size(); ++i )

代码示例来源:origin: FoundationDB/fdb-record-layer

@ValueSource(ints = {1, 2, 3})
@ParameterizedTest(name = "disjointUnionWithInnerLimits() [{0}]")
public void disjointUnionWithInnerLimits(int innerLimit) throws Exception {
  verifyUnionWithInnerLimits(cont -> scanRecordsBetween(10L, 22L, cont).limitRowsTo(innerLimit)
          .map(rec -> (FDBRecord<Message>) rec),
      cont -> scanRecordsBetween(50L, 62L, cont).limitRowsTo(innerLimit)
          .map(rec -> (FDBRecord<Message>) rec),
      LongStream.concat(LongStream.range(10L, 22L), LongStream.range(50L, 62L)).iterator());
}

相关文章

微信公众号

最新文章

更多