public abstract static class FloatBigSpliterators.EarlyBindingSizeIndexBasedSpliterator extends FloatBigSpliterators.AbstractIndexBasedSpliterator
This class implements an early binding strategy for getMaxPos(). The last index
this spliterator covers is fixed at construction time and does not vary on changes to the
backing data store. This should usually be the size of the
backing data store (until a split at least), hence the class' name, but this is not required.
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 | Field and Description |
|---|---|
protected long |
maxPos
The maximum
FloatBigSpliterators.AbstractIndexBasedSpliterator.pos can be |
pos| Modifier | Constructor and Description |
|---|---|
protected |
EarlyBindingSizeIndexBasedSpliterator(long initialPos,
long maxPos) |
| Modifier and Type | Method and Description |
|---|---|
protected long |
getMaxPos()
The maximum pos can be, and is the logical end (exclusive) of the "range".
|
characteristics, computeSplitPoint, estimateSize, forEachRemaining, get, makeForSplit, skip, tryAdvance, trySplitclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprotected final long maxPos
FloatBigSpliterators.AbstractIndexBasedSpliterator.pos can beprotected EarlyBindingSizeIndexBasedSpliterator(long initialPos,
long maxPos)
protected final long getMaxPos()
FloatBigSpliterators.AbstractIndexBasedSpliteratorIf pos is equal to the return of this method, this means the last element has been returned and the next call to FloatBigSpliterators.AbstractIndexBasedSpliterator.tryAdvance(it.unimi.dsi.fastutil.floats.FloatConsumer) will return false.
Usually set return the parent collection's size, but does not have to be (for example, sublists and subranges).
This method allows the implementation to decide how it binds on the size (late or early).
However, FloatBigSpliterators.EarlyBindingSizeIndexBasedSpliterator and FloatBigSpliterators.LateBindingSizeIndexBasedSpliterator give
an implementation of this method for the two most common strategies.
getMaxPos in class FloatBigSpliterators.AbstractIndexBasedSpliterator