org.dvb.tvanytime.metadata
Interface ListIterator


public interface ListIterator

An iterator which allows applications to traverse metadata fragments in a DatabaseQueryResult. Implementations which support java.util.ListIterator may use this as the parent interface.


Method Summary
 boolean hasNext()
          Returns true if this list iterator has more elements when traversing the list in the forward direction.
 boolean hasPrevious()
          Returns true if this list iterator has more elements when traversing the list in the reverse direction.
 java.lang.Object next()
          Returns the next element in the list.
 int nextIndex()
          Returns the index of the element that would be returned by a subsequent call to next.
 java.lang.Object previous()
          Returns the previous element in the list.
 int previousIndex()
          Returns the index of the element that would be returned by a subsequent call to previous.
 

Method Detail

hasNext

boolean hasNext()
Returns true if this list iterator has more elements when traversing the list in the forward direction. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:
true if the list iterator has more elements when traversing the list in the forward direction.

hasPrevious

boolean hasPrevious()
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.

next

java.lang.Object next()
Returns the next element in the list. This method may be called repeatedly to iterate through the list, or intermixed with calls to previous to go back and forth. (Note that alternating calls to next and previous will return the same element repeatedly.)

Returns:
the next element in the list.
Throws:
java.util.NoSuchElementException - if the iteration has no next element.

nextIndex

int nextIndex()
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.

previous

java.lang.Object previous()
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.
Throws:
java.util.NoSuchElementException - if the iteration has no previous element.

previousIndex

int previousIndex()
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.