Class OneElementIterator<T>
java.lang.Object
com.saperion.common.lang.iterator.OneElementIterator<T>
- Type Parameters:
T- type of objects to iterate
- All Implemented Interfaces:
Iterator<T>
An Iterator that iterates through exactly one element.
Iterator.remove() is not supported.
- Author:
- agz
-
Constructor Summary
ConstructorsConstructorDescriptionOneElementIterator(T object) Creates a newOneElementIterator, that iterates through exactly one (the specified) element. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
OneElementIterator
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
-
-
Method Details