Class EmptyIterator<T>
- java.lang.Object
-
- com.saperion.common.lang.iterator.EmptyIterator<T>
-
- Type Parameters:
T
- formal type of objects to iterate
- All Implemented Interfaces:
java.util.Iterator<T>
public final class EmptyIterator<T> extends java.lang.Object implements java.util.Iterator<T>
An empty
Iterator
that iterates through no elements.Use
getInstance()
to get an instance.This instance can be used in several threads concurrently.
- Author:
- agz
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> EmptyIterator<T>
getInstance()
Returns an instance ofEmptyIterator
.boolean
hasNext()
T
next()
void
remove()
java.lang.String
toString()
-
-
-
Method Detail
-
getInstance
public static <T> EmptyIterator<T> getInstance()
Returns an instance ofEmptyIterator
.- Type Parameters:
T
- formal type of objects to iterate- Returns:
- an instance of
EmptyIterator
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<T>
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<T>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-