Package de.intarsys.tools.collection
Class EmptyIterator
- java.lang.Object
-
- de.intarsys.tools.collection.EmptyIterator
-
- All Implemented Interfaces:
java.util.Iterator
public class EmptyIterator extends java.lang.Object implements java.util.IteratorAn Iterator over an empty collection.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.IteratorUNIQUE
-
Constructor Summary
Constructors Modifier Constructor Description protectedEmptyIterator()Create an EmptyIterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Return always false as an emtpy iterator has no elements.java.lang.Objectnext()Throw always exception, as an empty enumeration has no elements.voidremove()
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
Return always false as an emtpy iterator has no elements.- Specified by:
hasNextin interfacejava.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:
nextin interfacejava.util.Iterator- Returns:
- never
- Throws:
java.util.NoSuchElementException- Is thrown always
-
remove
public void remove()
- Specified by:
removein interfacejava.util.Iterator
-
-