public class ArrayListIterator<E> extends ArrayIterator<E> implements IterableListIterator<E>
ArrayListIterator
provides a ListIterator
for an array of objects.
The name might be a bit confusing: this is a ListIterator
for an Array Array
;
not an Iterator
for an ArrayList
.
Constructor and Description |
---|
ArrayListIterator(T... array)
Creates a new
ArrayListIterator for the specified array. |
ArrayListIterator(T[] array,
int start,
int length)
Creates a new
ArrayListIterator for the specified array, starting at the
specified start index and continuing for the specified length. |
Modifier and Type | Method and Description |
---|---|
void |
add(E item) |
boolean |
hasPrevious() |
java.util.ListIterator<E> |
iterator() |
int |
nextIndex() |
E |
previous() |
int |
previousIndex() |
void |
set(E item) |
hasNext, next, remove, toString
public ArrayListIterator(T... array)
ArrayListIterator
for the specified array.array
- The object containing the items to iterate overpublic ArrayListIterator(T[] array, int start, int length)
ArrayListIterator
for the specified array, starting at the
specified start index and continuing for the specified length.array
- The object containing the items to iterate overstart
- The beginning of the iterationlength
- The length of the iterationpublic boolean hasPrevious()
hasPrevious
in interface java.util.ListIterator<E>
public java.util.ListIterator<E> iterator()
iterator
in interface java.lang.Iterable<E>
iterator
in interface IterableListIterator<E>
iterator
in class ArrayIterator<E>
public int nextIndex()
nextIndex
in interface java.util.ListIterator<E>
public int previousIndex()
previousIndex
in interface java.util.ListIterator<E>
EclipseLink 2.4.2, "build v20130514-5956486" API Reference