de.intarsys.tools.collection
Class EmptyIterator

java.lang.Object
  extended by de.intarsys.tools.collection.EmptyIterator
All Implemented Interfaces:
java.util.Iterator

public class EmptyIterator
extends java.lang.Object
implements java.util.Iterator

An Iterator over an empty collection.


Field Summary
static java.util.Iterator UNIQUE
           
 
Constructor Summary
protected EmptyIterator()
          Create an EmptyIterator.
 
Method Summary
 boolean hasNext()
          Return always false as an emtpy iterator has no elements.
 java.lang.Object next()
          Throw always exception, as an empty enumeration has no elements.
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNIQUE

public static final java.util.Iterator UNIQUE
Constructor Detail

EmptyIterator

protected EmptyIterator()
Create an EmptyIterator.

Method Detail

hasNext

public boolean hasNext()
Return always false as an emtpy iterator has no elements.

Specified by:
hasNext in interface java.util.Iterator
Returns:
Return always false as an emtpy iterator has no elements.

next

public java.lang.Object next()
Throw always exception, as an empty enumeration has no elements.

Specified by:
next in interface java.util.Iterator
Returns:
never
Throws:
java.util.NoSuchElementException - Is thrown always

remove

public void remove()
Specified by:
remove in interface java.util.Iterator