本文整理匯總了Java中java.util.Spliterator.OfInt方法的典型用法代碼示例。如果您正苦於以下問題:Java Spliterator.OfInt方法的具體用法?Java Spliterator.OfInt怎麽用?Java Spliterator.OfInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.util.Spliterator
的用法示例。
在下文中一共展示了Spliterator.OfInt方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: forEachWithCancel
import java.util.Spliterator; //導入方法依賴的package包/類
@Override
final boolean forEachWithCancel(Spliterator<Integer> spliterator, Sink<Integer> sink) {
Spliterator.OfInt spl = adapt(spliterator);
IntConsumer adaptedSink = adapt(sink);
boolean cancelled;
do { } while (!(cancelled = sink.cancellationRequested()) && spl.tryAdvance(adaptedSink));
return cancelled;
}
示例2: OfInt
import java.util.Spliterator; //導入方法依賴的package包/類
OfInt(Spliterator.OfInt s, long skip, long limit) {
super(s, skip, limit);
}
示例3: makeSpliterator
import java.util.Spliterator; //導入方法依賴的package包/類
@Override
Spliterator.OfInt makeSpliterator(Spliterator.OfInt s) {
return new Dropping(s, this);
}
示例4: testIntSplitUntilNull
import java.util.Spliterator; //導入方法依賴的package包/類
@Test(dataProvider = "Spliterator.OfInt")
public void testIntSplitUntilNull(String description, Collection<Integer> exp, Supplier<Spliterator.OfInt> s) {
testSplitUntilNull(exp, s, intBoxingConsumer());
}
示例5: OfInt
import java.util.Spliterator; //導入方法依賴的package包/類
private OfInt(Spliterator.OfInt sp, boolean proxyEstimateSize) {
super(sp, proxyEstimateSize);
this.psp = sp;
}
示例6: spliterator
import java.util.Spliterator; //導入方法依賴的package包/類
@Override
Spliterator.OfInt spliterator();
示例7: OfInt
import java.util.Spliterator; //導入方法依賴的package包/類
OfInt(Spliterator.OfInt s, UnorderedWhileSpliterator.OfInt parent) {
super(s, parent);
this.p = parent.p;
}
示例8: testIntSplitAfterFullTraversal
import java.util.Spliterator; //導入方法依賴的package包/類
@Test(dataProvider = "Spliterator.OfInt")
public void testIntSplitAfterFullTraversal(String description, Collection<Integer> exp, Supplier<Spliterator.OfInt> s) {
testSplitAfterFullTraversal(s, intBoxingConsumer());
}
示例9: add
import java.util.Spliterator; //導入方法依賴的package包/類
void add(String description, Supplier<Spliterator.OfInt> s) {
add(description, exp, s);
}
示例10: testIntForEach
import java.util.Spliterator; //導入方法依賴的package包/類
@Test(dataProvider = "Spliterator.OfInt")
public void testIntForEach(String description, Collection<Integer> exp, Supplier<Spliterator.OfInt> s) {
testForEach(exp, s, intBoxingConsumer());
}
示例11: makeSpliterator
import java.util.Spliterator; //導入方法依賴的package包/類
@Override
protected Spliterator.OfInt makeSpliterator(Spliterator.OfInt s,
long sliceOrigin, long sliceFence,
long origin, long fence) {
return new SliceSpliterator.OfInt(s, sliceOrigin, sliceFence, origin, fence);
}
示例12: testIntMixedTraverseAndSplit
import java.util.Spliterator; //導入方法依賴的package包/類
@Test(dataProvider = "Spliterator.OfInt")
public void testIntMixedTraverseAndSplit(String description, Collection<Integer> exp, Supplier<Spliterator.OfInt> s) {
testMixedTraverseAndSplit(exp, s, intBoxingConsumer());
}
示例13: Dropping
import java.util.Spliterator; //導入方法依賴的package包/類
Dropping(Spliterator.OfInt s, boolean noSplitting, IntPredicate p) {
super(s, noSplitting, p);
}
示例14: concat
import java.util.Spliterator; //導入方法依賴的package包/類
/**
* Creates a lazily concatenated stream whose elements are all the
* elements of the first stream followed by all the elements of the
* second stream. The resulting stream is ordered if both
* of the input streams are ordered, and parallel if either of the input
* streams is parallel. When the resulting stream is closed, the close
* handlers for both input streams are invoked.
*
* @implNote
* Use caution when constructing streams from repeated concatenation.
* Accessing an element of a deeply concatenated stream can result in deep
* call chains, or even {@code StackOverflowException}.
*
* @param a the first stream
* @param b the second stream
* @return the concatenation of the two input streams
*/
public static IntStream concat(IntStream a, IntStream b) {
Objects.requireNonNull(a);
Objects.requireNonNull(b);
Spliterator.OfInt split = new Streams.ConcatSpliterator.OfInt(
a.spliterator(), b.spliterator());
IntStream stream = StreamSupport.intStream(split, a.isParallel() || b.isParallel());
return stream.onClose(Streams.composedClose(a, b));
}
示例15: intStream
import java.util.Spliterator; //導入方法依賴的package包/類
/**
* Creates a new sequential or parallel {@code IntStream} from a
* {@code Supplier} of {@code Spliterator.OfInt}.
*
* <p>The {@link Supplier#get()} method will be invoked on the supplier no
* more than once, and only after the terminal operation of the stream pipeline
* commences.
*
* <p>For spliterators that report a characteristic of {@code IMMUTABLE}
* or {@code CONCURRENT}, or that are
* <a href="../Spliterator.html#binding">late-binding</a>, it is likely
* more efficient to use {@link #intStream(java.util.Spliterator.OfInt, boolean)}
* instead.
* <p>The use of a {@code Supplier} in this form provides a level of
* indirection that reduces the scope of potential interference with the
* source. Since the supplier is only invoked after the terminal operation
* commences, any modifications to the source up to the start of the
* terminal operation are reflected in the stream result. See
* <a href="package-summary.html#NonInterference">Non-Interference</a> for
* more details.
*
* @param supplier a {@code Supplier} of a {@code Spliterator.OfInt}
* @param characteristics Spliterator characteristics of the supplied
* {@code Spliterator.OfInt}. The characteristics must be equal to
* {@code supplier.get().characteristics()}, otherwise undefined
* behavior may occur when terminal operation commences.
* @param parallel if {@code true} then the returned stream is a parallel
* stream; if {@code false} the returned stream is a sequential
* stream.
* @return a new sequential or parallel {@code IntStream}
* @see #intStream(java.util.Spliterator.OfInt, boolean)
*/
public static IntStream intStream(Supplier<? extends Spliterator.OfInt> supplier,
int characteristics,
boolean parallel) {
return new IntPipeline.Head<>(supplier,
StreamOpFlag.fromCharacteristics(characteristics),
parallel);
}