Top Description Fields Constructors Methods
org.eclipse.persistence.jpa.jpql.tools.utility.iterable

public Class SingleElementListIterable<E>

extends Object
implements ListIterable<E>
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.jpa.jpql.utility.iterable.ListIterable, java.lang.Iterable
Annotations
@SuppressWarnings:nls
Type Parameters
<E>
the type of elements returned by the list iterable's list iterator
Imports
java.util.ListIterator, org.eclipse.persistence.jpa.jpql.tools.utility.iterator.SingleElementListIterator, org.eclipse.persistence.jpa.jpql.utility.iterable.ListIterable

A 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.util.Collections#singletonList(Object).

See Also
SingleElementListIterator, SingleElementListIterable

Field Summary

Modifier and TypeField and Description
private final E

Constructor Summary

AccessConstructor and Description
public
SingleElementListIterable(E element)

Construct a list iterable that contains only the specified element.

Method Summary

Modifier and TypeMethod and Description
public ListIterator<E>
iterator()

Implements org.eclipse.persistence.jpa.jpql.utility.iterable.ListIterable.iterator.

Returns an iterator over elements of type T.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

elementback to summary
private final E element

Constructor Detail

SingleElementListIterableback to summary
public SingleElementListIterable(E element)

Construct a list iterable that contains only the specified element.

Method Detail

iteratorback to summary
public ListIterator<E> iterator()

Implements org.eclipse.persistence.jpa.jpql.utility.iterable.ListIterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:ListIterator<E>

an Iterator.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override