当前位置: 首页>>代码示例>>Java>>正文


Java Spliterator.OfInt方法代码示例

本文整理汇总了Java中java.util.Spliterator.OfInt方法的典型用法代码示例。如果您正苦于以下问题:Java Spliterator.OfInt方法的具体用法?Java Spliterator.OfInt怎么用?Java Spliterator.OfInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.Spliterator的用法示例。


在下文中一共展示了Spliterator.OfInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: forEachWithCancel

import java.util.Spliterator; //导入方法依赖的package包/类
@Override
final boolean forEachWithCancel(Spliterator<Integer> spliterator, Sink<Integer> sink) {
    Spliterator.OfInt spl = adapt(spliterator);
    IntConsumer adaptedSink = adapt(sink);
    boolean cancelled;
    do { } while (!(cancelled = sink.cancellationRequested()) && spl.tryAdvance(adaptedSink));
    return cancelled;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:IntPipeline.java

示例2: OfInt

import java.util.Spliterator; //导入方法依赖的package包/类
OfInt(Spliterator.OfInt s, long skip, long limit) {
    super(s, skip, limit);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:4,代码来源:StreamSpliterators.java

示例3: makeSpliterator

import java.util.Spliterator; //导入方法依赖的package包/类
@Override
Spliterator.OfInt makeSpliterator(Spliterator.OfInt s) {
    return new Dropping(s, this);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:WhileOps.java

示例4: testIntSplitUntilNull

import java.util.Spliterator; //导入方法依赖的package包/类
@Test(dataProvider = "Spliterator.OfInt")
public void testIntSplitUntilNull(String description, Collection<Integer> exp, Supplier<Spliterator.OfInt> s) {
    testSplitUntilNull(exp, s, intBoxingConsumer());
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:SpliteratorTraversingAndSplittingTest.java

示例5: OfInt

import java.util.Spliterator; //导入方法依赖的package包/类
private OfInt(Spliterator.OfInt sp, boolean proxyEstimateSize) {
    super(sp, proxyEstimateSize);
    this.psp = sp;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:StreamSpliteratorTest.java

示例6: spliterator

import java.util.Spliterator; //导入方法依赖的package包/类
@Override
Spliterator.OfInt spliterator();
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:3,代码来源:IntStream.java

示例7: OfInt

import java.util.Spliterator; //导入方法依赖的package包/类
OfInt(Spliterator.OfInt s, UnorderedWhileSpliterator.OfInt parent) {
    super(s, parent);
    this.p = parent.p;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:WhileOps.java

示例8: testIntSplitAfterFullTraversal

import java.util.Spliterator; //导入方法依赖的package包/类
@Test(dataProvider = "Spliterator.OfInt")
public void testIntSplitAfterFullTraversal(String description, Collection<Integer> exp, Supplier<Spliterator.OfInt> s) {
    testSplitAfterFullTraversal(s, intBoxingConsumer());
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:SpliteratorTraversingAndSplittingTest.java

示例9: add

import java.util.Spliterator; //导入方法依赖的package包/类
void add(String description, Supplier<Spliterator.OfInt> s) {
    add(description, exp, s);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:4,代码来源:SpliteratorTraversingAndSplittingTest.java

示例10: testIntForEach

import java.util.Spliterator; //导入方法依赖的package包/类
@Test(dataProvider = "Spliterator.OfInt")
public void testIntForEach(String description, Collection<Integer> exp, Supplier<Spliterator.OfInt> s) {
    testForEach(exp, s, intBoxingConsumer());
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:SpliteratorTraversingAndSplittingTest.java

示例11: makeSpliterator

import java.util.Spliterator; //导入方法依赖的package包/类
@Override
protected Spliterator.OfInt makeSpliterator(Spliterator.OfInt s,
                                            long sliceOrigin, long sliceFence,
                                            long origin, long fence) {
    return new SliceSpliterator.OfInt(s, sliceOrigin, sliceFence, origin, fence);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:7,代码来源:StreamSpliterators.java

示例12: testIntMixedTraverseAndSplit

import java.util.Spliterator; //导入方法依赖的package包/类
@Test(dataProvider = "Spliterator.OfInt")
public void testIntMixedTraverseAndSplit(String description, Collection<Integer> exp, Supplier<Spliterator.OfInt> s) {
    testMixedTraverseAndSplit(exp, s, intBoxingConsumer());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:SpliteratorTraversingAndSplittingTest.java

示例13: Dropping

import java.util.Spliterator; //导入方法依赖的package包/类
Dropping(Spliterator.OfInt s, boolean noSplitting, IntPredicate p) {
    super(s, noSplitting, p);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:4,代码来源:WhileOps.java

示例14: concat

import java.util.Spliterator; //导入方法依赖的package包/类
/**
 * Creates a lazily concatenated stream whose elements are all the
 * elements of the first stream followed by all the elements of the
 * second 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.
 *
 * @implNote
 * Use caution when constructing streams from repeated concatenation.
 * Accessing an element of a deeply concatenated stream can result in deep
 * call chains, or even {@code StackOverflowException}.
 *
 * @param a the first stream
 * @param b the second stream
 * @return the concatenation of the two input streams
 */
public static IntStream concat(IntStream a, IntStream b) {
    Objects.requireNonNull(a);
    Objects.requireNonNull(b);

    Spliterator.OfInt split = new Streams.ConcatSpliterator.OfInt(
            a.spliterator(), b.spliterator());
    IntStream stream = StreamSupport.intStream(split, a.isParallel() || b.isParallel());
    return stream.onClose(Streams.composedClose(a, b));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:IntStream.java

示例15: intStream

import java.util.Spliterator; //导入方法依赖的package包/类
/**
 * Creates a new sequential or parallel {@code IntStream} from a
 * {@code Supplier} of {@code Spliterator.OfInt}.
 *
 * <p>The {@link Supplier#get()} method will be invoked on the supplier no
 * more than once, and only after the terminal operation of the stream pipeline
 * commences.
 *
 * <p>For spliterators that report a characteristic of {@code IMMUTABLE}
 * or {@code CONCURRENT}, or that are
 * <a href="../Spliterator.html#binding">late-binding</a>, it is likely
 * more efficient to use {@link #intStream(java.util.Spliterator.OfInt, boolean)}
 * instead.
 * <p>The use of a {@code Supplier} in this form provides a level of
 * indirection that reduces the scope of potential interference with the
 * source.  Since the supplier is only invoked after the terminal operation
 * commences, any modifications to the source up to the start of the
 * terminal operation are reflected in the stream result.  See
 * <a href="package-summary.html#NonInterference">Non-Interference</a> for
 * more details.
 *
 * @param supplier a {@code Supplier} of a {@code Spliterator.OfInt}
 * @param characteristics Spliterator characteristics of the supplied
 *        {@code Spliterator.OfInt}.  The characteristics must be equal to
 *        {@code supplier.get().characteristics()}, otherwise undefined
 *        behavior may occur when terminal operation commences.
 * @param parallel if {@code true} then the returned stream is a parallel
 *        stream; if {@code false} the returned stream is a sequential
 *        stream.
 * @return a new sequential or parallel {@code IntStream}
 * @see #intStream(java.util.Spliterator.OfInt, boolean)
 */
public static IntStream intStream(Supplier<? extends Spliterator.OfInt> supplier,
                                  int characteristics,
                                  boolean parallel) {
    return new IntPipeline.Head<>(supplier,
                                  StreamOpFlag.fromCharacteristics(characteristics),
                                  parallel);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:40,代码来源:StreamSupport.java


注:本文中的java.util.Spliterator.OfInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。