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.Iterator
An Iterator over an empty collection.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Iterator
UNIQUE
-
Constructor Summary
Constructors Modifier Constructor Description protected
EmptyIterator()
Create an EmptyIterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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()
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
Return always false as an emtpy iterator has no elements.- Specified by:
hasNext
in 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:
next
in interfacejava.util.Iterator
- Returns:
- never
- Throws:
java.util.NoSuchElementException
- Is thrown always
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator
-
-