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:
java..
SingleElementListIterator, SingleElementListIterable
| Modifier and Type | Field and Description |
|---|---|
| private final E |
| Access | Constructor and Description |
|---|---|
| public | SingleElementListIterable(E element)
Construct a list iterable that contains only the specified element. |
| Modifier and Type | Method and Description |
|---|---|
| public ListIterator | iterator()
Implements org. T.
|
| public String |
| element | back to summary |
|---|---|
| private final E element | |
| SingleElementListIterable | back to summary |
|---|---|
| public SingleElementListIterable(E element) Construct a list iterable that contains only the specified element. | |
| iterator | back to summary |
|---|---|
| public ListIterator Implements org. Doc from java. Returns an iterator over elements of type
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |