Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.adfnmc.java.util
Interface ListIterator

All Superinterfaces:
Iterator

public interface ListIterator
extends Iterator

An ListIterator is used to sequence over a List of objects. ListIterator can move backwards or forwards through the List.


Method Summary
 void add(java.lang.Object object)
          Inserts the specified object into the list between next and previous.
 boolean hasNext()
          Answers if there are more elements to iterate.
 boolean hasPrevious()
          Answers if there are previous elements to iterate.
 java.lang.Object next()
          Answers the next object in the iteration.
 int nextIndex()
          Answers the index of the next object in the iteration.
 java.lang.Object previous()
          Answers the previous object in the iteration.
 int previousIndex()
          Answers the index of the previous object in the iteration.
 void remove()
          Removes the last object returned by next or previous from the list.
 void set(java.lang.Object object)
          Replaces the last object returned by next or previous with the specified object.
 

Method Detail

add

void add(java.lang.Object 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
Throws:
java.lang.UnsupportedOperationException - when adding is not supported by the list being iterated
java.lang.ClassCastException - when the class of the object is inappropriate for the list
java.lang.IllegalArgumentException - when the object cannot be added to the list

hasNext

boolean hasNext()
Answers if there are more elements to iterate.

Specified by:
hasNext in interface Iterator
Returns:
true if there are more elements, false otherwise
See Also:
next()

hasPrevious

boolean hasPrevious()
Answers if there are previous elements to iterate.

Returns:
true if there are previous elements, false otherwise
See Also:
previous()

next

java.lang.Object next()
Answers the next object in the iteration.

Specified by:
next in interface Iterator
Returns:
the next object
Throws:
NoSuchElementException - when there are no more elements
See Also:
hasNext()

nextIndex

int nextIndex()
Answers the index of the next object in the iteration.

Returns:
the index of the next object
Throws:
NoSuchElementException - when there are no more elements
See Also:
next()

previous

java.lang.Object previous()
Answers the previous object in the iteration.

Returns:
the previous object
Throws:
NoSuchElementException - when there are no previous elements
See Also:
hasPrevious()

previousIndex

int previousIndex()
Answers the index of the previous object in the iteration.

Returns:
the index of the previous object
Throws:
NoSuchElementException - when there are no previous elements
See Also:
previous()

remove

void remove()
Removes the last object returned by next or previous from the list.

Specified by:
remove in interface Iterator
Throws:
java.lang.UnsupportedOperationException - when removing is not supported by the list being iterated
java.lang.IllegalStateException - when next or previous have not been called, or remove or add have already been called after the last call to next or previous

set

void set(java.lang.Object object)
Replaces the last object returned by next or previous with the specified object.

Parameters:
object - the object to add
Throws:
java.lang.UnsupportedOperationException - when adding is not supported by the list being iterated
java.lang.ClassCastException - when the class of the object is inappropriate for the list
java.lang.IllegalArgumentException - when the object cannot be added to the list
java.lang.IllegalStateException - when next or previous have not been called, or remove or add have already been called after the last call to next or previous

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.