Class calitha.collections.IListIterator
Extends
calitha.collections.IIterator.
An iterator for lists that allows the programmer to traverse the list in either direction,
modify the list during iteration, and obtain the iterator's current position in the list.
It is based on the
Java ListIterator interface.
Defined in: IListIterator.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
add(obj)
Inserts the specified element into the list.
|
|
Returns true if this list iterator has more elements when traversing the list in the reverse direction.
|
|
Returns the index of the element that would be returned by a subsequent call to next.
|
|
previous()
Returns the previous element in the list.
|
|
Returns the index of the element that would be returned by a subsequent call to previous.
|
|
set(obj)
Replaces the last element returned by next or previous with the specified element.
|
- Methods borrowed from class calitha.collections.IIterator:
- hasNext, next, remove
Method Detail
add(obj)
Inserts the specified element into the list.
- Parameters:
- {Object} obj
- the element with which to replace the last element returned by next or previous.
{Boolean}
hasPrevious()
Returns true if this list iterator has more elements when traversing the list in the reverse direction.
- Returns:
- {Boolean} true if the list iterator has more elements when traversing the list in the reverse direction.
{Number}
nextIndex()
Returns the index of the element that would be returned by a subsequent call to next.
- Returns:
- {Number} 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.
{Object}
previous()
Returns the previous element in the list.
- Returns:
- {Object} the previous element in the list.
{Number}
previousIndex()
Returns the index of the element that would be returned by a subsequent call to previous.
- Returns:
- {Number} 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.
set(obj)
Replaces the last element returned by next or previous with the specified element.
- Parameters:
- {Object} obj
- the element with which to replace the last element returned by next or previous.