org.jikesrvm.util
Class EmptyIterator<T>

java.lang.Object
  extended by 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.


Field Summary
private static EmptyIterator<?> INSTANCE
           
 
Constructor Summary
private EmptyIterator()
          Clients must use getInstance() to obtain an instance.
 
Method Summary
static
<U> Iterator<U>
getInstance()
           
 boolean hasNext()
           
 T next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

private static final EmptyIterator<?> INSTANCE
Constructor Detail

EmptyIterator

private EmptyIterator()
Clients must use getInstance() to obtain an instance.

Method Detail

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()