本文整理匯總了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();
}