public abstract static class LongSpliterators.AbstractIndexBasedSpliterator extends AbstractLongSpliterator
This class is only appropriate for sequences that are at most Integer.MAX_VALUE
long.
If your backing data store can be bigger then this, consider the equivalently named class in
the type specific BigSpliterators
class.
As the abstract methods in this class are used in inner loops, it is generally a
good idea to override the class as final
as to encourage the JVM to inline
them (or alternatively, override the abstract methods as final).
Modifier and Type | Method and Description |
---|---|
int |
characteristics() |
long |
estimateSize() |
void |
forEachRemaining(java.util.function.LongConsumer action) |
long |
skip(long n)
Skips the given number of elements.
|
boolean |
tryAdvance(java.util.function.LongConsumer action) |
LongSpliterator |
trySplit() |
forEachRemaining, tryAdvance
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, getComparator, tryAdvance
public int characteristics()
public long estimateSize()
public boolean tryAdvance(java.util.function.LongConsumer action)
public void forEachRemaining(java.util.function.LongConsumer action)
public long skip(long n)
LongSpliterator
The effect of this call is exactly the same as that of calling LongSpliterator.tryAdvance(java.util.function.Consumer<? super java.lang.Long>)
for
n
times (possibly stopping if LongSpliterator.tryAdvance(java.util.function.Consumer<? super java.lang.Long>)
returns false).
The action called will do nothing; elements will be discarded.
n
- the number of elements to skip.Spliterator.tryAdvance(java.util.function.Consumer<? super T>)
public LongSpliterator trySplit()
java.lang.IndexOutOfBoundsException
- if the return of computeSplitPoint()
was
< pos
or > {@link #getMaxPos()}
.Spliterator.ORDERED
property. This means this current iterator does not need to
to update what getMaxPos()
returns in response to this method (but it may do
"book-keeping" on it based on binding strategy).
The split point is computed by computeSplitPoint()
; see that method for details.