protected class AbstractSafeLongArray.SafeIterator extends Object implements LongArray.Iterator<V>
Modifier and Type | Field and Description |
---|---|
protected LongArray.Iterator<V> |
f_delegate
The delegate iterator.
|
protected long |
m_lIndexLast
The index associated with the last returned value
|
protected Object |
m_valueLast
The last value returned from the iterator.
|
Modifier | Constructor and Description |
---|---|
protected |
SafeIterator(LongArray<V> delegate,
boolean fForward,
long lIndexFrom) |
Modifier and Type | Method and Description |
---|---|
protected void |
ensureValid()
Ensure that the cached value/index are valid.
|
long |
getIndex()
Returns the index of the current value, which is the value returned
by the most recent call to the next method.
|
V |
getValue()
Returns the current value, which is the same value returned by the
most recent call to the next method, or the most recent
value passed to setValue if setValue were called
after the next method.
|
boolean |
hasNext()
Returns true if the iteration has more elements.
|
V |
next()
Returns the next element in the iteration.
|
void |
remove()
Removes from the underlying collection the last element returned by
the iterator (optional operation).
|
V |
setValue(V oValue)
Stores a new value at the current value index, returning the value
that was replaced.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
protected final LongArray.Iterator<V> f_delegate
protected Object m_valueLast
protected long m_lIndexLast
public boolean hasNext()
LongArray.Iterator
public V next()
LongArray.Iterator
public long getIndex()
LongArray.Iterator
getIndex
in interface LongArray.Iterator<V>
public V getValue()
LongArray.Iterator
getValue
in interface LongArray.Iterator<V>
public V setValue(V oValue)
LongArray.Iterator
setValue
in interface LongArray.Iterator<V>
oValue
- the new value to storepublic void remove()
LongArray.Iterator
protected void ensureValid()