E
- the type of elements returned by the list iterable's list iteratorpublic class SingleElementListIterable<E> extends Object implements ListIterable<E>
SingleElementListIterable
returns a ListIterator
that holds a single element
and returns it with the first call to ListIterator.next()
, at
which point it will return false
to any subsequent
call to ListIterator.hasNext()
. Likewise, it will return false
to a call to ListIterator.hasPrevious()
until a call to ListIterator.next()
,
at which point a call to ListIterator.previous()
will return the
single element.
A SingleElementListIterable
is equivalent to the
Iterable
returned by:
Collections.singletonList(Object)
.
SingleElementListIterator
,
SingleElementIterable
Constructor and Description |
---|
SingleElementListIterable(E element)
Construct a list iterable that contains only the specified element.
|
Modifier and Type | Method and Description |
---|---|
ListIterator<E> |
iterator() |
String |
toString() |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public SingleElementListIterable(E element)
EclipseLink 2.5.2, "build v20140319-9ad6abd" API Reference