org.objectweb.dream.util
Class EmptyIterator<T>

java.lang.Object
  extended by org.objectweb.dream.util.EmptyIterator<T>
Type Parameters:
T - type of objects, over which empty iterator iterates (:-))
All Implemented Interfaces:
Iterator<T>

public final class EmptyIterator<T>
extends Object
implements Iterator<T>

An empty iterator implementation. The hasNext()method always returns false. The constructor is private. As a consequence, only one instance of this class exists, and can be referenced using the INSTANCEconstant.


Field Summary
static Iterator<String> EMPTY_STRING_ITERATOR
          A constant instance of EmptyIterator<String>
static EmptyIterator INSTANCE
          A constant instance of EmptyIterator
 
Constructor Summary
EmptyIterator()
          default constructor.
 
Method Summary
 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

public static final EmptyIterator INSTANCE
A constant instance of EmptyIterator


EMPTY_STRING_ITERATOR

public static final Iterator<String> EMPTY_STRING_ITERATOR
A constant instance of EmptyIterator<String>

Constructor Detail

EmptyIterator

public EmptyIterator()
default constructor.

Method Detail

remove

public void remove()
Specified by:
remove in interface Iterator<T>
See Also:
Iterator.remove()

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<T>
See Also:
Iterator.hasNext()

next

public T next()
Specified by:
next in interface Iterator<T>
See Also:
Iterator.next()


Copyright © 2003, 2005 - INRIA Rhone-Alpes - All Rights Reserved.