org.jikesrvm.util
Class EmptyIterator<T>
java.lang.Object
org.jikesrvm.util.EmptyIterator<T>
- All Implemented Interfaces:
- Iterator<T>
public final class EmptyIterator<T>
- extends Object
- implements Iterator<T>
A generic iterator containing no items.
NOTE: This class is only necessary until Java 7. Java 7's Collections
class provides an emptyIterator()
method.
TODO Remove this class when we require Java 7 to build and all supported
class libraries support Java 7.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANCE
private static final EmptyIterator<?> INSTANCE
EmptyIterator
private EmptyIterator()
- Clients must use
getInstance()
to obtain an instance.
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface Iterator<T>
next
public T next()
- Specified by:
next
in interface Iterator<T>
remove
public void remove()
- Specified by:
remove
in interface Iterator<T>
getInstance
public static <U> Iterator<U> getInstance()