public static class Stepper.OfIntSpliterator extends java.lang.Object implements IntStepper, java.util.function.IntConsumer
Stepper.OfDoubleSpliterator, Stepper.OfIntSpliterator, Stepper.OfLongSpliterator, Stepper.OfSpliterator<A>, Stepper.UnboxingByteStepper, Stepper.UnboxingCharStepper, Stepper.UnboxingDoubleStepper, Stepper.UnboxingFloatStepper, Stepper.UnboxingIntStepper, Stepper.UnboxingLongStepper, Stepper.UnboxingShortStepper
Constructor and Description |
---|
OfIntSpliterator(java.util.Spliterator.OfInt sp) |
Modifier and Type | Method and Description |
---|---|
void |
accept(int i) |
int |
characteristics()
Characteristics are bit flags that indicate runtime characteristics of this Stepper.
|
long |
estimateSize() |
void |
forEachRemaining(java.util.function.IntConsumer c) |
boolean |
hasNext() |
int |
nextInt() |
IntStepper |
substep()
Attempt to split this
Stepper in half, with the new (returned) copy taking the first half
of the collection, and this one advancing to cover the second half. |
boolean |
tryAdvance(java.util.function.IntConsumer c) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, hasStep, knownSize, nextStep, parStream, seqStream, spliterator, tryAdvance, trySplit, tryStep
accumulate
anticipateParallelism, count, count, exists, find, fold, foldTo, foreach, iterator, reduce, to
public void accept(int i)
accept
in interface java.util.function.IntConsumer
public int characteristics()
StepperLike
- Distinct
means that no duplicates exist
- Immutable
means that the underlying collection is guaranteed not to change during traversal
- NonNull
means that no nulls will be returned during traversal
- Sized
means that the collection knows its exact size
- SubSized
means that sub-Steppers created with substep()
will also know their own size. SubSized
steppers must also be Sized
.
The Java flags CONCURRENT
and SORTED
are not supported; modification of a concurrency-aware underlying collection is not
guaranteed to be any safer than modification of any generic mutable collection, and if the underlying collection is ordered by
virtue of sorting, Stepper
will not keep track of that fact.
characteristics
in interface java.util.Spliterator<java.lang.Integer>
characteristics
in interface StepperLike<java.lang.Object,IntStepper>
public long estimateSize()
estimateSize
in interface java.util.Spliterator<java.lang.Integer>
public void forEachRemaining(java.util.function.IntConsumer c)
forEachRemaining
in interface java.util.PrimitiveIterator<java.lang.Integer,java.util.function.IntConsumer>
forEachRemaining
in interface java.util.PrimitiveIterator.OfInt
forEachRemaining
in interface java.util.Spliterator.OfInt
forEachRemaining
in interface java.util.Spliterator.OfPrimitive<java.lang.Integer,java.util.function.IntConsumer,java.util.Spliterator.OfInt>
forEachRemaining
in interface IntStepper
public boolean hasNext()
hasNext
in interface java.util.Iterator<java.lang.Integer>
public int nextInt()
nextInt
in interface java.util.PrimitiveIterator.OfInt
public IntStepper substep()
StepperLike
Stepper
in half, with the new (returned) copy taking the first half
of the collection, and this one advancing to cover the second half. If subdivision is not
possible or not advisable, substep()
will return null
.substep
in interface StepperLike<java.lang.Object,IntStepper>
public boolean tryAdvance(java.util.function.IntConsumer c)
tryAdvance
in interface java.util.Spliterator.OfInt
tryAdvance
in interface java.util.Spliterator.OfPrimitive<java.lang.Integer,java.util.function.IntConsumer,java.util.Spliterator.OfInt>
tryAdvance
in interface IntStepper