#include <src/main/decaf/util/concurrent/CopyOnWriteArrayList.h>
Public Member Functions |
| ArrayListIterator (decaf::lang::Pointer< Array > array, int index) |
virtual | ~ArrayListIterator () |
virtual E | next () |
| Returns the next element in the iteration.
|
virtual bool | hasNext () const |
| Returns true if the iteration has more elements.
|
virtual void | remove () |
| Removes from the underlying collection the last element returned by the iterator (optional operation).
|
virtual void | add (const E &e DECAF_UNUSED) |
virtual void | set (const E &e DECAF_UNUSED) |
virtual bool | hasPrevious () const |
| Returns true if this list iterator has more elements when traversing the list in the reverse direction.
|
virtual E | previous () |
| Returns the previous element in the list.
|
virtual int | nextIndex () const |
| Returns the index of the element that would be returned by a subsequent call to next.
|
virtual int | previousIndex () const |
| Returns the index of the element that would be returned by a subsequent call to previous.
|
virtual | ~ListIterator () |
virtual void | add (const E &e)=0 |
| Inserts the specified element into the list (optional operation).
|
virtual void | set (const E &e)=0 |
| Replaces the last element returned by next or previous with the specified element (optional operation).
|
virtual | ~Iterator () |
Constructor & Destructor Documentation
Member Function Documentation
Returns true if the iteration has more elements.
Returns false if the next call to next would result in an NoSuchElementException to be thrown.
- Returns
- true if there are more elements available for iteration.
Implements decaf::util::Iterator< E >.
Returns true if this list iterator has more elements when traversing the list in the reverse direction.
(In other words, returns true if previous would return an element rather than throwing an exception.)
- Returns
- true if the list iterator has more elements when traversing the list in the reverse direction.
Implements decaf::util::ListIterator< E >.
Returns the next element in the iteration.
Calling this method repeatedly until the hasNext() method returns false will return each element in the underlying collection exactly once.
- Returns
- the next element in the iteration of elements.
- Exceptions
-
Implements decaf::util::Iterator< E >.
Returns the index of the element that would be returned by a subsequent call to next.
(Returns list size if the list iterator is at the end of the list.)
- Returns
- the index of the element that would be returned by a subsequent call to next, or list size if list iterator is at end of list.
Implements decaf::util::ListIterator< E >.
Returns the previous element in the list.
This method may be called repeatedly to iterate through the list backwards, or intermixed with calls to next to go back and forth. (Note that alternating calls to next and previous will return the same element repeatedly.)
- Returns
- the previous element in the list.
- Exceptions
-
Implements decaf::util::ListIterator< E >.
Returns the index of the element that would be returned by a subsequent call to previous.
(Returns -1 if the list iterator is at the beginning of the list.)
- Returns
- the index of the element that would be returned by a subsequent call to previous, or -1 if list iterator is at beginning of list.
Implements decaf::util::ListIterator< E >.
Removes from the underlying collection the last element returned by the iterator (optional operation).
This method can be called only once per call to next. The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method.
- Exceptions
-
UnsupportedOperationException | if the remove operation is not supported by this Iterator. |
IllegalStateException | if the next method has not yet been called, or the remove method has already been called after the last call to the next method. |
Implements decaf::util::Iterator< E >.
The documentation for this class was generated from the following file: