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
ConstructorDescriptionSingleElementListIterator
(E element) Creates a newSingleElementListIterator
that returns only the specified element. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
SingleElementListIterator
Creates a newSingleElementListIterator
that returns only the specified element.- Parameters:
element
- The only element of thisIterator
-
-
Method Details
-
add
- Specified by:
add
in interfaceListIterator<E>
-
hasNext
public boolean hasNext() -
hasPrevious
public boolean hasPrevious()- Specified by:
hasPrevious
in interfaceListIterator<E>
-
iterator
-
next
-
nextIndex
public int nextIndex()- Specified by:
nextIndex
in interfaceListIterator<E>
-
previous
- Specified by:
previous
in interfaceListIterator<E>
-
previousIndex
public int previousIndex()- Specified by:
previousIndex
in interfaceListIterator<E>
-
remove
public void remove() -
set
- Specified by:
set
in interfaceListIterator<E>
-
toString
-