public class XShortArrayIterator extends Object implements XShortIterator
XShortIterator
that wraps a short array.Constructor and Description |
---|
XShortArrayIterator(short[] array)
Constructs a new array iterator.
|
XShortArrayIterator(short[] array,
int offset,
int length)
Constructs a new array iterator.
|
Modifier and Type | Method and Description |
---|---|
short[] |
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).
|
short |
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.
|
XShortIterator |
toFirst()
Resets the iterator to the beginning.
|
public XShortArrayIterator(short[] array)
array
- The array to iterate.public XShortArrayIterator(short[] 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 short[] array()
public final int offset()
public final int length()
public final boolean hasNext()
XShortIterator
hasNext
in interface XShortIterator
public final short next()
XShortIterator
next
in interface XShortIterator
public final void remove()
remove
in interface XShortIterator
UnsupportedOperationException
- If called.public final XShortIterator toFirst()
XShortIterator
toFirst
in interface XShortIterator
Copyright © 2019 Neeve Research, LLC. All Rights Reserved.