Top Description Fields Constructors Methods
org.apache.commons.collections4.iterators

public Class EmptyIterator<E>

extends AbstractEmptyIterator<E>
implements ResettableIterator<E>
Class Inheritance
All Implemented Interfaces
org.apache.commons.collections4.ResettableIterator, java.util.Iterator
Imports
java.util.Iterator, org.apache.commons.collections4.ResettableIterator

Provides an implementation of an empty iterator.

This class provides an implementation of an empty iterator. This class provides for binary compatibility between Commons Collections 2.1.1 and 3.1 due to issues with IteratorUtils.

Since
2.1.1 and 3.1

Field Summary

Modifier and TypeField and Description
public static final Iterator<E>
INSTANCE

Singleton instance of the iterator.

public static final ResettableIterator<E>
RESETTABLE_INSTANCE

Singleton instance of the iterator.

Constructor Summary

AccessConstructor and Description
protected
EmptyIterator()

Constructor.

Method Summary

Modifier and TypeMethod and Description
public static <
the element type
E
>
Iterator<E>

Returns:

Iterator<E>
emptyIterator
()

Get a typed empty iterator instance.

public static <
the element type
E
>
ResettableIterator<E>

Returns:

ResettableIterator<E>
resettableEmptyIterator
()

Get a typed resettable empty iterator instance.

Inherited from org.apache.commons.collections4.iterators.AbstractEmptyIterator:
addhasNexthasPreviousnextnextIndexpreviouspreviousIndexremoveresetset

Field Detail

INSTANCEback to summary
public static final Iterator<E> INSTANCE

Singleton instance of the iterator.

Annotations
@SuppressWarnings:rawtypes
Since
2.1.1 and 3.1
RESETTABLE_INSTANCEback to summary
public static final ResettableIterator<E> RESETTABLE_INSTANCE

Singleton instance of the iterator.

Annotations
@SuppressWarnings:rawtypes
Since
3.1

Constructor Detail

EmptyIteratorback to summary
protected EmptyIterator()

Constructor.

Method Detail

emptyIteratorback to summary
public static <E> Iterator<E> emptyIterator()

Get a typed empty iterator instance.

Parameters
<E>
the element type
Returns:Iterator<E>

Iterator<E>

resettableEmptyIteratorback to summary
public static <E> ResettableIterator<E> resettableEmptyIterator()

Get a typed resettable empty iterator instance.

Parameters
<E>
the element type
Returns:ResettableIterator<E>

ResettableIterator<E>