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 privateEmptyIterator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(T t)static <T> EmptyIterator<T>getInstance()booleanhasNext()booleanhasPrevious()Tnext()intnextIndex()Tprevious()intpreviousIndex()voidremove()voidset(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:
hasPreviousin interfacejava.util.ListIterator<T>
-
nextIndex
public int nextIndex()
- Specified by:
nextIndexin interfacejava.util.ListIterator<T>
-
previousIndex
public int previousIndex()
- Specified by:
previousIndexin interfacejava.util.ListIterator<T>
-
-