Package org.eclipse.collections.impl
Class EmptyIterator<T>
- java.lang.Object
-
- org.eclipse.collections.impl.EmptyIterator<T>
-
- All Implemented Interfaces:
java.util.Iterator<T>
,java.util.ListIterator<T>
public final class EmptyIterator<T> extends java.lang.Object implements java.util.ListIterator<T>
A Singleton iterator which is empty and can be used by all empty collections.
-
-
Field Summary
Fields Modifier and Type Field Description private static EmptyIterator<?>
INSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description private
EmptyIterator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(T t)
static <T> EmptyIterator<T>
getInstance()
boolean
hasNext()
boolean
hasPrevious()
T
next()
int
nextIndex()
T
previous()
int
previousIndex()
void
remove()
void
set(T t)
-
-
-
Field Detail
-
INSTANCE
private static final EmptyIterator<?> INSTANCE
-
-
Method Detail
-
getInstance
public static <T> EmptyIterator<T> getInstance()
-
hasNext
public boolean hasNext()
-
next
public T next()
-
remove
public void remove()
-
hasPrevious
public boolean hasPrevious()
- Specified by:
hasPrevious
in interfacejava.util.ListIterator<T>
-
nextIndex
public int nextIndex()
- Specified by:
nextIndex
in interfacejava.util.ListIterator<T>
-
previousIndex
public int previousIndex()
- Specified by:
previousIndex
in interfacejava.util.ListIterator<T>
-
-