net.sf.mmm.util.collection.base
Class EmptyIterator

java.lang.Object
  extended by net.sf.mmm.util.collection.base.EmptyIterator
All Implemented Interfaces:
Iterator<Object>

public class EmptyIterator
extends Object
implements Iterator<Object>

This is an implementation of the Iterator interface that is always empty. It will never have any next element.

Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
private static EmptyIterator INSTANCE
           
 
Constructor Summary
EmptyIterator()
          The constructor.
 
Method Summary
static
<E> Iterator<E>
getInstance()
          This method gets the singleton instance of this empty iterator.
 boolean hasNext()
          
 Object 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
See Also:
getInstance()
Constructor Detail

EmptyIterator

public EmptyIterator()
The constructor.

Method Detail

getInstance

public static <E> Iterator<E> getInstance()
This method gets the singleton instance of this empty iterator.

Type Parameters:
E - is the type of the element to iterate.
Returns:
the empty iterator instance.

hasNext

public boolean hasNext()

Specified by:
hasNext in interface Iterator<Object>

next

public Object next()

Specified by:
next in interface Iterator<Object>

remove

public void remove()

Specified by:
remove in interface Iterator<Object>


Copyright © 2001-2010 mmm-Team. All Rights Reserved.