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>
ASingleElementListIterable
returns aListIterator
that holds a single element and returns it with the first call toListIterator.next()
, at which point it will returnfalse
to any subsequent call toListIterator.hasNext()
. Likewise, it will returnfalse
to a call toListIterator.hasPrevious()
until a call toListIterator.next()
, at which point a call toListIterator.previous()
will return the single element.A
SingleElementListIterable
is equivalent to theIterable
returned 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()
String
toString()
-
Methods inherited from class java.lang.Object
equals, 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.
-
-