本文整理汇总了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)");
}
}
示例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);
}
示例3: OfLong
import java.util.Spliterator; //导入方法依赖的package包/类
OfLong(Spliterator.OfLong s, long skip, long limit) {
super(s, skip, limit);
}
示例4: OfLong
import java.util.Spliterator; //导入方法依赖的package包/类
private OfLong(Spliterator.OfLong sp, boolean proxyEstimateSize) {
super(sp, proxyEstimateSize);
this.psp = sp;
}
示例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());
}
示例6: spliterator
import java.util.Spliterator; //导入方法依赖的package包/类
@Override
public Spliterator.OfLong spliterator() {
return new InternalNodeSpliterator.OfLong(this);
}
示例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);
}
示例8: spliterator
import java.util.Spliterator; //导入方法依赖的package包/类
@Override
public Spliterator.OfLong spliterator() {
return Spliterators.emptyLongSpliterator();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例13: makeSpliterator
import java.util.Spliterator; //导入方法依赖的package包/类
@Override
Spliterator.OfLong makeSpliterator(Spliterator.OfLong s) {
return new Dropping(s, this);
}
示例14: OfLong
import java.util.Spliterator; //导入方法依赖的package包/类
OfLong(Spliterator.OfLong s, boolean noSplitting, LongPredicate p) {
super(s, noSplitting);
this.p = p;
}
示例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();
}