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

x33g5p2x  于2022-01-20 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(124)

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

IntStream.spliterator介绍

暂无

代码示例

代码示例来源:origin: speedment/speedment

@Override
  public Spliterator.OfInt execute() {
    try (final IntStream stream = buildPrevious()) {
      return stream.spliterator();
    }
  }
}

代码示例来源:origin: google/guava

return new WithCharacteristics(IntStream.range(0, size).spliterator());

代码示例来源:origin: speedment/speedment

default Spliterator.OfInt spliterator(IntPipeline pipeline) {
  requireNonNull(pipeline);
  return optimize(pipeline).getAsIntStream().spliterator();
}

代码示例来源:origin: google/j2objc

return new WithCharacteristics(IntStream.range(0, size).spliterator());

代码示例来源:origin: google/guava

/**
 * Appends all values from {@code stream}, in order, to the end of the values the built {@link
 * ImmutableIntArray} will contain.
 */
public Builder addAll(IntStream stream) {
 Spliterator.OfInt spliterator = stream.spliterator();
 long size = spliterator.getExactSizeIfKnown();
 if (size > 0) { // known *and* nonempty
  ensureRoomFor(Ints.saturatedCast(size));
 }
 spliterator.forEachRemaining((IntConsumer) this::add);
 return this;
}

代码示例来源:origin: wildfly/wildfly

return new WithCharacteristics(IntStream.range(0, size).spliterator());

代码示例来源:origin: prestodb/presto

return new WithCharacteristics(IntStream.range(0, size).spliterator());

代码示例来源:origin: prestodb/presto

/**
 * Appends all values from {@code stream}, in order, to the end of the values the built {@link
 * ImmutableIntArray} will contain.
 */
public Builder addAll(IntStream stream) {
 Spliterator.OfInt spliterator = stream.spliterator();
 long size = spliterator.getExactSizeIfKnown();
 if (size > 0) { // known *and* nonempty
  ensureRoomFor(Ints.saturatedCast(size));
 }
 spliterator.forEachRemaining((IntConsumer) this::add);
 return this;
}

代码示例来源:origin: speedment/speedment

@Override
public Spliterator.OfInt spliterator() {
  if (isAllowStreamIteratorAndSpliterator()) {
    return stream().spliterator();
  }
  throw newUnsupportedException("spliterator");
}

代码示例来源:origin: google/guava

checkNotNull(function);
boolean isParallel = stream.isParallel();
Spliterator.OfInt fromSpliterator = stream.spliterator();

代码示例来源:origin: wildfly/wildfly

/**
 * Appends all values from {@code stream}, in order, to the end of the values the built {@link
 * ImmutableIntArray} will contain.
 */
public Builder addAll(IntStream stream) {
 Spliterator.OfInt spliterator = stream.spliterator();
 long size = spliterator.getExactSizeIfKnown();
 if (size > 0) { // known *and* nonempty
  ensureRoomFor(Ints.saturatedCast(size));
 }
 spliterator.forEachRemaining((IntConsumer) this::add);
 return this;
}

代码示例来源:origin: google/j2objc

checkNotNull(function);
boolean isParallel = stream.isParallel();
Spliterator.OfInt fromSpliterator = stream.spliterator();

代码示例来源:origin: wildfly/wildfly

checkNotNull(function);
boolean isParallel = stream.isParallel();
Spliterator.OfInt fromSpliterator = stream.spliterator();

代码示例来源:origin: prestodb/presto

checkNotNull(function);
boolean isParallel = stream.isParallel();
Spliterator.OfInt fromSpliterator = stream.spliterator();

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

/**
 * Construct a ReactiveSeq from a String
 *
 * @param input String to construct ReactiveSeq from
 * @return ReactiveSeq from a String
 */
public static OneShotStreamX<Integer> fromCharSequence(CharSequence input){
  return Streams.<Integer>oneShotStream(input.chars().spliterator(),Optional.empty());
}

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

/**
 * Peform intermediate operations on a primitive IntStream (gives improved performance when working with Integers)
 * If this ReactiveSeq has an OfInt Spliterator it will be converted directly to an IntStream,
 * otherwise the provided conversion function will be used.
 *
 * <pre>
 * {@code
 * ReactiveSeq.range(1, 1000)
 *            .ints(i->i,s->s.map(i->i*2).filter(i->i<500))
       .size(),
  //249
 *
 * </pre>
 *
 *
 * @param fn
 * @param mapper
 * @return
 */
default ReactiveSeq<Integer> ints(ToIntFunction<? super T> fn,Function<? super IntStream, ? extends IntStream> mapper){
  return ReactiveSeq.fromSpliterator(mapper.apply(mapToInt(fn)).spliterator());
}

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

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

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

public static Function<? super ReactiveSeq<Integer>, ? extends ReactiveSeq<Integer>> concatInts( ReactiveSeq<Integer> b){
  return a->ReactiveSeq.fromSpliterator(IntStream.concat(a.mapToInt(i->i),b.mapToInt(i->i)).spliterator());
}

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

/**
 * Construct a ReactiveSeq from a String
 *
 * @param input String to construct ReactiveSeq from
 * @return ReactiveSeq from a String
 */
public static OneShotStreamX<Integer> fromCharSequence(CharSequence input){
  return Streams.<Integer>oneShotStream(input.chars().spliterator(),Optional.empty());
}

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

/**
 * Construct a ReactiveSeq from a String
 *
 * @param input String to construct ReactiveSeq from
 * @return ReactiveSeq from a String
 */
public static OneShotStreamX<Integer> fromCharSequence(CharSequence input){
  return Streams.<Integer>oneShotStream(input.chars().spliterator(),Optional.empty());
}

相关文章

微信公众号

最新文章

更多