Package com.fasterxml.aalto.util
Class EmptyIterator<T>
- java.lang.Object
-
- com.fasterxml.aalto.util.EmptyIterator<T>
-
- All Implemented Interfaces:
java.util.Iterator<T>
public final class EmptyIterator<T> extends java.lang.Object implements java.util.Iterator<T>Simple implementation of "null iterator", iterator that has nothing to iterate over.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static EmptyIterator<java.lang.Object>sInstance
-
Constructor Summary
Constructors Modifier Constructor Description privateEmptyIterator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> EmptyIterator<T>getInstance()Since the actual type has no effect (as this iterator never returns any value objects), we can just cast away here: bit unclean, but safe.booleanhasNext()Tnext()voidremove()
-
-
-
Field Detail
-
sInstance
static final EmptyIterator<java.lang.Object> sInstance
-
-
Method Detail
-
getInstance
public static <T> EmptyIterator<T> getInstance()
Since the actual type has no effect (as this iterator never returns any value objects), we can just cast away here: bit unclean, but safe.
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<T>
-
remove
public void remove()
- Specified by:
removein interfacejava.util.Iterator<T>
-
-