public class XLongArrayIterator extends Object implements XLongIterator
XLongIterator that wraps a long array.| Constructor and Description |
|---|
XLongArrayIterator(long[] array)
Constructs a new array iterator.
|
XLongArrayIterator(long[] array,
int offset,
int length)
Constructs a new array iterator.
|
| Modifier and Type | Method and Description |
|---|---|
long[] |
array()
The array backing this iterator.
|
boolean |
hasNext()
Returns true if the iteration has more elements.
|
int |
length()
Gets the length of the iterator (the number of elements it returns
starting with the offset).
|
long |
next()
Returns the next element in the iteration.
|
int |
offset()
Gets the offset into the backing array at which this
iterator starts.
|
void |
remove()
Remove is not supported for array iterators.
|
XLongIterator |
toFirst()
Resets the iterator to the beginning.
|
public XLongArrayIterator(long[] array)
array - The array to iterate.public XLongArrayIterator(long[] array,
int offset,
int length)
array - The backing array.offset - The offset into the array.length - The length the number of elements including the offset to iterate.public final long[] array()
public final int offset()
public final int length()
public final boolean hasNext()
XLongIteratorhasNext in interface XLongIteratorpublic final long next()
XLongIteratornext in interface XLongIteratorpublic final void remove()
remove in interface XLongIteratorUnsupportedOperationException - If called.public final XLongIterator toFirst()
XLongIteratortoFirst in interface XLongIteratorCopyright © 2019 Neeve Research, LLC. All Rights Reserved.