java.util
public
interface
java.util.ListIterator<E>
An ListIterator is used to sequence over a List of objects. ListIterator can
move backwards or forwards through the List.
Summary
Details
Public Methods
public
void
add(E object)
Inserts the specified object into the list between
next
and
previous
. The object inserted will be the previous
object.
Parameters
object
| the object to insert |
public
boolean
hasNext()
Returns if there are more elements to iterate.
Returns
- true if there are more elements, false otherwise
public
boolean
hasPrevious()
Returns if there are previous elements to iterate.
Returns
- true if there are previous elements, false otherwise
public
E
next()
Returns the next object in the iteration.
public
int
nextIndex()
Returns the index of the next object in the iteration.
Returns
- the index of the next object
public
E
previous()
Returns the previous object in the iteration.
public
int
previousIndex()
Returns the index of the previous object in the iteration.
Returns
- the index of the previous object
public
void
remove()
Removes the last object returned by
next
or
previous
from the list.
public
void
set(E object)
Replaces the last object returned by
next
or
previous
with the specified object.