當前位置: 首頁>>代碼示例>>Java>>正文


Java Spliterator.SUBSIZED屬性代碼示例

本文整理匯總了Java中java.util.Spliterator.SUBSIZED屬性的典型用法代碼示例。如果您正苦於以下問題:Java Spliterator.SUBSIZED屬性的具體用法?Java Spliterator.SUBSIZED怎麽用?Java Spliterator.SUBSIZED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.util.Spliterator的用法示例。


在下文中一共展示了Spliterator.SUBSIZED屬性的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: characteristics

@Override
public final int characteristics() {
    init();

    // Get the characteristics from the pipeline
    int c = StreamOpFlag.toCharacteristics(StreamOpFlag.toStreamFlags(ph.getStreamAndOpFlags()));

    // Mask off the size and uniform characteristics and replace with
    // those of the spliterator
    // Note that a non-uniform spliterator can change from something
    // with an exact size to an estimate for a sub-split, for example
    // with HashSet where the size is known at the top level spliterator
    // but for sub-splits only an estimate is known
    if ((c & Spliterator.SIZED) != 0) {
        c &= ~(Spliterator.SIZED | Spliterator.SUBSIZED);
        c |= (spliterator.characteristics() & (Spliterator.SIZED | Spliterator.SUBSIZED));
    }

    return c;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:20,代碼來源:StreamSpliterators.java

示例2: resources

@Override
public Stream<URL> resources(String name) {
    Objects.requireNonNull(name);
    // ordering not specified
    int characteristics = (Spliterator.NONNULL | Spliterator.IMMUTABLE |
                           Spliterator.SIZED | Spliterator.SUBSIZED);
    Supplier<Spliterator<URL>> supplier = () -> {
        try {
            List<URL> urls = findResourcesAsList(name);
            return Spliterators.spliterator(urls, characteristics);
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    };
    Stream<URL> s1 = StreamSupport.stream(supplier, characteristics, false);
    Stream<URL> s2 = parent.resources(name);
    return Stream.concat(s1, s2);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:18,代碼來源:Loader.java

示例3: characteristics

@Override
public int characteristics() {
    if (beforeSplit) {
        // Concatenation loses DISTINCT and SORTED characteristics
        return aSpliterator.characteristics() & bSpliterator.characteristics()
               & ~(Spliterator.DISTINCT | Spliterator.SORTED
                   | (unsized ? Spliterator.SIZED | Spliterator.SUBSIZED : 0));
    }
    else {
        return bSpliterator.characteristics();
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:12,代碼來源:Streams.java

示例4: CharsSpliterator

CharsSpliterator(byte[] array, int origin, int fence, int acs) {
    this.array = array;
    this.index = origin;
    this.fence = fence;
    this.cs = acs | Spliterator.ORDERED | Spliterator.SIZED
              | Spliterator.SUBSIZED;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:7,代碼來源:StringUTF16.java

示例5: characteristics

@Override
public int characteristics() {
    if (proxyEstimateSize)
        return sp.characteristics();
    else
        return sp.characteristics() & ~(Spliterator.SUBSIZED | Spliterator.SIZED);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:7,代碼來源:StreamSpliteratorTest.java

示例6: assertSpliterator

private static void assertSpliterator(Spliterator<?> s, int rootCharacteristics) {
    if ((rootCharacteristics & Spliterator.SUBSIZED) != 0) {
        assertTrue(s.hasCharacteristics(Spliterator.SUBSIZED),
                   "Child split is not SUBSIZED when root split is SUBSIZED");
    }
    assertSpliterator(s);
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:7,代碼來源:SpliteratorTraversingAndSplittingTest.java

示例7: characteristics

@Override
public int characteristics() {
    return Spliterator.ORDERED | Spliterator.SIZED | Spliterator.SUBSIZED |
           Spliterator.IMMUTABLE | Spliterator.NONNULL |
           Spliterator.DISTINCT | Spliterator.SORTED;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:6,代碼來源:Streams.java

示例8: characteristics

public int characteristics() {
    return (Spliterator.SIZED | Spliterator.SUBSIZED |
            Spliterator.NONNULL | Spliterator.IMMUTABLE);
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:4,代碼來源:ThreadLocalRandom.java

示例9: characteristics

@Override
public int characteristics() {
    // Size is not known
    return s.characteristics() & ~(Spliterator.SIZED | Spliterator.SUBSIZED);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:5,代碼來源:WhileOps.java


注:本文中的java.util.Spliterator.SUBSIZED屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。