Class ListIteratorImpl<E>
- java.lang.Object
-
- org.pepstock.charba.client.commons.IteratorImpl<E>
-
- org.pepstock.charba.client.commons.ListIteratorImpl<E>
-
- Type Parameters:
E- type of list
- All Implemented Interfaces:
Iterator<E>,ListIterator<E>
public final class ListIteratorImpl<E> extends IteratorImpl<E> implements ListIterator<E>
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.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(E e)Inserts the specified element in the listbooleanhasPrevious()Returns true if this list iterator has more elements when traversing the list in the forward direction.intnextIndex()Returns the index of the element that would be returned by a subsequent call tonext().Eprevious()Returns the previous element in the list and moves the cursor position backwards.intpreviousIndex()Returns the index of the element that would be returned by a subsequent call toprevious().voidset(E e)Replaces the last element returned by next() or previous() with the specified element .-
Methods inherited from class org.pepstock.charba.client.commons.IteratorImpl
hasNext, next, remove
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Methods inherited from interface java.util.ListIterator
hasNext, next, remove
-
-
-
-
Method Detail
-
hasPrevious
public boolean hasPrevious()
Returns true if this list iterator has more elements when traversing the list in the forward direction.- Specified by:
hasPreviousin interfaceListIterator<E>
-
nextIndex
public int nextIndex()
Returns the index of the element that would be returned by a subsequent call tonext().- Specified by:
nextIndexin interfaceListIterator<E>
-
previousIndex
public int previousIndex()
Returns the index of the element that would be returned by a subsequent call toprevious().- Specified by:
previousIndexin interfaceListIterator<E>
-
previous
public E previous()
Returns the previous element in the list and moves the cursor position backwards.- Specified by:
previousin interfaceListIterator<E>
-
set
public void set(E e)
Replaces the last element returned by next() or previous() with the specified element .- Specified by:
setin interfaceListIterator<E>
-
add
public void add(E e)
Inserts the specified element in the list- Specified by:
addin interfaceListIterator<E>
-
-