public class SingleElementListIterator<E> extends java.lang.Object implements IterableListIterator<E>
SingleElementListIterator holds a single element and returns it with the first
call to next(), at which point it will return false to any subsequent call
to hasNext(). Likewise, it will return false to a call to hasPrevious()<
until a call to next(), at which point a call to previous() will return the
single element.| Constructor and Description |
|---|
SingleElementListIterator(E element)
Creates a new
SingleElementListIterator that returns only the specified element. |
public SingleElementListIterator(E element)
SingleElementListIterator that returns only the specified element.element - The only element of this Iteratorpublic boolean hasNext()
public boolean hasPrevious()
hasPrevious in interface java.util.ListIterator<E>public java.util.ListIterator<E> iterator()
iterator in interface java.lang.Iterable<E>iterator in interface IterableListIterator<E>public E next()
public int nextIndex()
nextIndex in interface java.util.ListIterator<E>public int previousIndex()
previousIndex in interface java.util.ListIterator<E>public void remove()
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()EclipseLink 2.4.2, "build v20130514-5956486" API Reference