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

public final Class EmptyIterable<E>

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

An EmptyIterable is just that. Maybe just a touch better-performing than java.util.Collections#EMPTY_SET since we don't create a new Iterator every time iterator() is called. (Not sure why they do that....)
Since
2.5
Version
2.5
See Also
EmptyIterator, EmptyListIterable

Field Summary

Modifier and TypeField and Description
private static final Iterable<Object>
INSTANCE

The singleton instance of this EmptyIterable.

private static final long
serialVersionUID

The serial version UID of this class.

Constructor Summary

AccessConstructor and Description
private
EmptyIterable()

Creates a new EmptyIterable and insures single instance.

Method Summary

Modifier and TypeMethod and Description
public static <T> Iterable<T>

Returns:

The singleton instance
instance
()

Return the singleton instance of this Iterable.

public Iterator<E>
iterator()

Implements java.lang.Iterable.iterator.

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

Overrides java.lang.Object.toString.

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

Field Detail

INSTANCEback to summary
private static final Iterable<Object> INSTANCE

The singleton instance of this EmptyIterable.

serialVersionUIDback to summary
private static final long serialVersionUID

The serial version UID of this class.

Constructor Detail

EmptyIterableback to summary
private EmptyIterable()

Creates a new EmptyIterable and insures single instance.

Method Detail

instanceback to summary
public static <T> Iterable<T> instance()

Return the singleton instance of this Iterable.

Returns:Iterable<T>

The singleton instance

Annotations
@SuppressWarnings:unchecked
iteratorback to summary
public Iterator<E> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<E>

an Iterator.

Annotations
@Override
readResolveback to summary
private Object readResolve()
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