当前位置: 首页>>代码示例>>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;未经允许,请勿转载。