Class OneElementIterator<T>
- java.lang.Object
-
- com.saperion.common.lang.iterator.OneElementIterator<T>
-
- Type Parameters:
T- type of objects to iterate
- All Implemented Interfaces:
java.util.Iterator<T>
public final class OneElementIterator<T> extends java.lang.Object implements java.util.Iterator<T>An
Iteratorthat iterates through exactly one element.Iterator.remove()is not supported.- Author:
- agz
-
-
Constructor Summary
Constructors Constructor Description OneElementIterator(T object)Creates a newOneElementIterator, that iterates through exactly one (the specified) element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Tnext()voidremove()java.lang.StringtoString()
-
-
-
Constructor Detail
-
OneElementIterator
public OneElementIterator(T object)
Creates a newOneElementIterator, that iterates through exactly one (the specified) element. The specified object may benull. The newOneElementIteratorwill still have one element and its first call to next() will returnnull.- Parameters:
object- object to iterate through
-
-