@GwtCompatible public abstract class ForwardingListIterator<E> extends ForwardingIterator<E> implements ListIterator<E>
A list iterator which forwards all its method calls to another list iterator. Subclasses should override one or more methods to modify the behavior of the backing iterator as desired per the decorator pattern.
| Modifier | Constructor and Description |
|---|---|
protected |
ForwardingListIterator()
Constructor for use by subclasses.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(E element) |
protected abstract ListIterator<E> |
delegate()
Returns the backing delegate instance that methods are forwarded to.
|
boolean |
hasPrevious() |
int |
nextIndex() |
E |
previous() |
int |
previousIndex() |
void |
set(E element) |
hasNext, next, removetoStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithasNext, next, removeforEachRemainingprotected ForwardingListIterator()
Constructor for use by subclasses.
protected abstract ListIterator<E> delegate()
ForwardingObjectReturns the backing delegate instance that methods are forwarded to. Abstract subclasses generally override this method with an abstract method that has a more specific return type, such as ForwardingSet.delegate(). Concrete subclasses override this method to supply the instance being decorated.
delegate in class ForwardingIterator<E>public void add(E element)
add in interface ListIterator<E>public boolean hasPrevious()
hasPrevious in interface ListIterator<E>public int nextIndex()
nextIndex in interface ListIterator<E>public E previous()
previous in interface ListIterator<E>public int previousIndex()
previousIndex in interface ListIterator<E>public void set(E element)
set in interface ListIterator<E>