Class SingleElementListIterator<E>
java.lang.Object
org.eclipse.persistence.jpa.jpql.tools.utility.iterator.SingleElementListIterator<E>
- All Implemented Interfaces:
Iterator<E>,ListIterator<E>
A
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.- Since:
- 2.4
- Version:
- 2.4
-
Constructor Summary
ConstructorsConstructorDescriptionSingleElementListIterator(E element) Creates a newSingleElementListIteratorthat returns only the specified element. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
SingleElementListIterator
Creates a newSingleElementListIteratorthat returns only the specified element.- Parameters:
element- The only element of thisIterator
-
-
Method Details
-
add
- Specified by:
addin interfaceListIterator<E>
-
hasNext
public boolean hasNext() -
hasPrevious
public boolean hasPrevious()- Specified by:
hasPreviousin interfaceListIterator<E>
-
iterator
-
next
-
nextIndex
public int nextIndex()- Specified by:
nextIndexin interfaceListIterator<E>
-
previous
- Specified by:
previousin interfaceListIterator<E>
-
previousIndex
public int previousIndex()- Specified by:
previousIndexin interfaceListIterator<E>
-
remove
public void remove() -
set
- Specified by:
setin interfaceListIterator<E>
-
toString
-