|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.lang.XArrayIterator<T>
public class XArrayIterator<T>
An XIterator
that iterates over an array.
Constructor Summary | |
---|---|
XArrayIterator(T[] array)
Constructs a new array iterator. |
|
XArrayIterator(T[] array,
int offset,
int length)
Constructs a new array iterator. |
Method Summary | |
---|---|
T[] |
array()
The array backing this iterator. |
boolean |
hasNext()
|
int |
length()
Gets the length of the iterator (the number of elements it returns starting with the offset). |
T |
next()
|
int |
offset()
Gets the offset into the backing array at which this iterator starts. |
void |
remove()
Remove is not supported for array iterators. |
XArrayIterator<T> |
toFirst()
Resets the iterator to the first element. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XArrayIterator(T[] array)
array
- The array to iterate.public XArrayIterator(T[] 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.Method Detail |
---|
public final T[] array()
public final int offset()
public final int length()
public final boolean hasNext()
hasNext
in interface Iterator<T>
public final T next()
next
in interface Iterator<T>
public final void remove()
remove
in interface Iterator<T>
UnsupportedOperationException
- If called.public final XArrayIterator<T> toFirst()
XIterator
toFirst
in interface XIterator<T>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |