/** Abstraction of a position in an ordered collection. At any* given time, THIS represents a position (called its cursor)* that is just after some number of items of type T (0 or more) of* a particular collection, called the underlying collection. */
publicinterfaceListIterator<T>extendsIterator<T>{
/* Exceptions: Methods that return items from the collection throw* NoSuchElementException if there is no appropriate item. Optional* methods throw UnsupportedOperationException if the method is not* supported. */
/* Required metho ds: */
/** True unless THIS is past the last item of the collection */
booleanhasNext();
/** True unless THIS is before the first item of the collection */
booleanhasPrevious();
/** Returns the item immediately after the cursor, and* moves the current position to just after that item.* Throws NoSuchElementException if there is no such item. */
Tnext();
/** Returns the item immediately before the cursor, and* moves the current position to just before that item.* Throws NoSuchElementException if there is no such item. */
Tprevious();
/** The number of items before the cursor */
intnextIndex();
/* nextIndex () - 1 */
intpreviousIndex();
/* Optional methods: *//** Insert item X into the underlying collection immediately before* the cursor (X will be returned by previous()). */
voidadd(Tx);
/** Remove the item returned by the most recent call to .next ()* or .previous (). There must not have been a more recent* call to .add(). */
voidremove();
/** Replace the item returned by the most recent call to .next ()* or .previous () with X in the underlying collection.* There must not have been a more recent call to .add() or .remove. */