Class SingleElementListIterable<E>
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.utility.iterable.SingleElementListIterable<E>
-
- Type Parameters:
E- the type of elements returned by the list iterable's list iterator
- All Implemented Interfaces:
Iterable<E>,ListIterable<E>
public class SingleElementListIterable<E> extends Object implements ListIterable<E>
ASingleElementListIterablereturns aListIteratorthat holds a single element and returns it with the first call toListIterator.next(), at which point it will returnfalseto any subsequent call toListIterator.hasNext(). Likewise, it will returnfalseto a call toListIterator.hasPrevious()until a call toListIterator.next(), at which point a call toListIterator.previous()will return the single element.A
SingleElementListIterableis equivalent to theIterablereturned by:Collections.singletonList(Object).
-
-
Constructor Summary
Constructors Constructor Description SingleElementListIterable(E element)Construct a list iterable that contains only the specified element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListIterator<E>iterator()StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
SingleElementListIterable
public SingleElementListIterable(E element)
Construct a list iterable that contains only the specified element.
-
-