| |
|
| java.lang.Object org.apache.commons.collections.iterators.ArrayIterator org.apache.commons.collections.iterators.ArrayListIterator
Field Summary | |
protected int | lastItemIndex Holds the index of the last item returned by a call to next()
or previous() . |
Constructor Summary | |
public | ArrayListIterator() Constructor for use with setArray . | public | ArrayListIterator(Object array) Constructs an ArrayListIterator that will iterate over the values in the
specified array. | public | ArrayListIterator(Object array, int startIndex) Constructs an ArrayListIterator that will iterate over the values in the
specified array from a specific start index. | public | ArrayListIterator(Object array, int startIndex, int endIndex) Construct an ArrayListIterator that will iterate over a range of values
in the specified array. |
lastItemIndex | protected int lastItemIndex(Code) | | Holds the index of the last item returned by a call to next()
or previous() . This is set to -1 if neither method
has yet been invoked. lastItemIndex is used to to implement
the
ArrayListIterator.set method.
|
ArrayListIterator | public ArrayListIterator()(Code) | | Constructor for use with setArray .
Using this constructor, the iterator is equivalent to an empty iterator
until
ArrayListIterator.setArray(Object) is called to establish the array to iterate over.
|
ArrayListIterator | public ArrayListIterator(Object array)(Code) | | Constructs an ArrayListIterator that will iterate over the values in the
specified array.
Parameters: array - the array to iterate over throws: IllegalArgumentException - if array is not an array. throws: NullPointerException - if array is null |
ArrayListIterator | public ArrayListIterator(Object array, int startIndex)(Code) | | Constructs an ArrayListIterator that will iterate over the values in the
specified array from a specific start index.
Parameters: array - the array to iterate over Parameters: startIndex - the index to start iterating at throws: IllegalArgumentException - if array is not an array. throws: NullPointerException - if array is null throws: IndexOutOfBoundsException - if the start index is out of bounds |
ArrayListIterator | public ArrayListIterator(Object array, int startIndex, int endIndex)(Code) | | Construct an ArrayListIterator that will iterate over a range of values
in the specified array.
Parameters: array - the array to iterate over Parameters: startIndex - the index to start iterating at Parameters: endIndex - the index (exclusive) to finish iterating at throws: IllegalArgumentException - if array is not an array. throws: IndexOutOfBoundsException - if the start or end index is out of bounds throws: IllegalArgumentException - if end index is before the start throws: NullPointerException - if array is null |
hasPrevious | public boolean hasPrevious()(Code) | | Returns true if there are previous elements to return from the array.
true if there is a previous element to return |
nextIndex | public int nextIndex()(Code) | | Gets the next index to be retrieved.
the index of the item to be retrieved next |
previousIndex | public int previousIndex()(Code) | | Gets the index of the item to be retrieved if
ArrayListIterator.previous() is called.
the index of the item to be retrieved next |
reset | public void reset()(Code) | | Resets the iterator back to the start index.
|
|
|
|