Class SingleElementListIterator<E>
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.utility.iterator.SingleElementListIterator<E>
-
- All Implemented Interfaces:
java.util.Iterator<E>,java.util.ListIterator<E>
public class SingleElementListIterator<E> extends java.lang.Object implements java.util.ListIterator<E>ASingleElementListIteratorholds a single element and returns it with the first call tonext(), at which point it will returnfalseto any subsequent call tohasNext(). Likewise, it will returnfalseto a call tohasPrevious()until a call tonext(), at which point a call toprevious()will return the single element.- Version:
- 2.4
- Since:
- 2.4
-
-
Constructor Summary
Constructors Constructor Description SingleElementListIterator(E element)Creates a newSingleElementListIteratorthat returns only the specified element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(E item)booleanhasNext()booleanhasPrevious()java.util.ListIterator<E>iterator()Enext()intnextIndex()Eprevious()intpreviousIndex()voidremove()voidset(E item)java.lang.StringtoString()
-
-
-
Constructor Detail
-
SingleElementListIterator
public SingleElementListIterator(E element)
Creates a newSingleElementListIteratorthat returns only the specified element.- Parameters:
element- The only element of thisIterator
-
-
Method Detail
-
hasNext
public boolean hasNext()
-
hasPrevious
public boolean hasPrevious()
- Specified by:
hasPreviousin interfacejava.util.ListIterator<E>
-
iterator
public java.util.ListIterator<E> iterator()
-
next
public E next()
-
nextIndex
public int nextIndex()
- Specified by:
nextIndexin interfacejava.util.ListIterator<E>
-
previousIndex
public int previousIndex()
- Specified by:
previousIndexin interfacejava.util.ListIterator<E>
-
remove
public void remove()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
-