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


Java Spliterator.OfLong方法代码示例

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


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

示例1: adapt

import java.util.Spliterator; //导入方法依赖的package包/类
/**
 * Adapt a {@code Spliterator<Long>} to a {@code Spliterator.OfLong}.
 *
 * @implNote
 * The implementation attempts to cast to a Spliterator.OfLong, and throws
 * an exception if this cast is not possible.
 */
private static Spliterator.OfLong adapt(Spliterator<Long> s) {
    if (s instanceof Spliterator.OfLong) {
        return (Spliterator.OfLong) s;
    } else {
        if (Tripwire.ENABLED)
            Tripwire.trip(AbstractPipeline.class,
                          "using LongStream.adapt(Spliterator<Long> s)");
        throw new UnsupportedOperationException("LongStream.adapt(Spliterator<Long> s)");
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:LongPipeline.java

示例2: trySplit

import java.util.Spliterator; //导入方法依赖的package包/类
@Override
public Spliterator.OfLong trySplit() {
    long size = estimateSize();
    return size <= 1
           ? null
           // Left split always has a half-open range
           : new RangeLongSpliterator(from, from = from + splitPoint(size), 0);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:Streams.java

示例3: OfLong

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

示例4: OfLong

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

示例5: testLongSplitOnce

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

示例6: spliterator

import java.util.Spliterator; //导入方法依赖的package包/类
@Override
public Spliterator.OfLong spliterator() {
    return new InternalNodeSpliterator.OfLong(this);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:Nodes.java

示例7: trySplit

import java.util.Spliterator; //导入方法依赖的package包/类
@Override
public Spliterator.OfLong trySplit() {
    if (estimate == 0)
        return null;
    return new InfiniteSupplyingSpliterator.OfLong(estimate = estimate >>> 1, s);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:StreamSpliterators.java

示例8: spliterator

import java.util.Spliterator; //导入方法依赖的package包/类
@Override
public Spliterator.OfLong spliterator() {
    return Spliterators.emptyLongSpliterator();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:Nodes.java

示例9: lazySpliterator

import java.util.Spliterator; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
final Spliterator.OfLong lazySpliterator(Supplier<? extends Spliterator<Long>> supplier) {
    return new StreamSpliterators.DelegatingSpliterator.OfLong((Supplier<Spliterator.OfLong>) supplier);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:LongPipeline.java

示例10: testLongSpliterator

import java.util.Spliterator; //导入方法依赖的package包/类
@Test(dataProvider = "LongSpliterator", dataProviderClass = LongStreamTestDataProvider.class )
public void testLongSpliterator(String name, Supplier<Spliterator.OfLong> supplier) {
    SpliteratorTestHelper.testLongSpliterator(supplier);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:SpliteratorTest.java

示例11: makeSpliterator

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

示例12: OfLong

import java.util.Spliterator; //导入方法依赖的package包/类
OfLong(Spliterator.OfLong s,
       long sliceOrigin, long sliceFence, long origin, long fence) {
    super(s, sliceOrigin, sliceFence, origin, fence);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:StreamSpliterators.java

示例13: makeSpliterator

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

示例14: OfLong

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

示例15: trySplit

import java.util.Spliterator; //导入方法依赖的package包/类
@Override
public Spliterator.OfLong trySplit() {
    // Do not split if all operations are cancelled
    return cancel.get() ? null : super.trySplit();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:WhileOps.java


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