public class PrimitiveSparseArray.Iterator extends AbstractSparseArray.Crawler implements LongArray.Iterator<Long>
Modifier | Constructor and Description |
---|---|
protected |
Iterator(AbstractSparseArray.Node head,
int fromdir,
boolean fForward)
Instantiate a new PrimitiveIterator at the specified location and
direction.
|
Modifier and Type | Method and Description |
---|---|
long |
getPrimitiveValue()
Returns the current value, which is the same value returned by the
most recent call to the nextPrimitive method, or the most
recent value passed to setPrimitiveValue if
setPrimitiveValue were called after the
nextPrimitive method.
|
long |
nextPrimitive()
Returns the next element (as a long) in the iteration.
|
long |
setPrimitiveValue(long lValue)
Stores a new value at the current value index, returning the value
that was replaced.
|
clone, currentNode, getIndex, getValue, hasNext, next, nextNode, remove, setValue, toString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getIndex, getValue, hasNext, next, remove, setValue
forEachRemaining
protected Iterator(AbstractSparseArray.Node head, int fromdir, boolean fForward)
head
- the node at which to start the crawlfromdir
- the direction in which to start the crawlpublic long nextPrimitive()
NoSuchElementException
- iteration has no more elementspublic long getPrimitiveValue()
IllegalStateException
- if the next method has
not yet been called, or the remove method has
already been called after the last call to the
next method.public long setPrimitiveValue(long lValue)
IllegalStateException
- if the next method has
not yet been called, or the remove method has
already been called after the last call to the
next method.