當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。