intarsys runtime library

de.intarsys.tools.collection
Class EmptyIterator

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

public class EmptyIterator
extends Object
implements Iterator

An Iterator over an empty collection.


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

Field Detail

UNIQUE

public static final Iterator UNIQUE
Method Detail

hasNext

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

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

next

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

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

remove

public void remove()
Specified by:
remove in interface Iterator

intarsys runtime library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.