Package org.apache.flink.runtime.util
Class SingleElementIterator<E>
- java.lang.Object
-
- org.apache.flink.runtime.util.SingleElementIterator<E>
-
- Type Parameters:
E
- The generic type of the iterator.
public final class SingleElementIterator<E> extends Object implements Iterator<E>, Iterable<E>
AnIterator
that contains only a single element. The element can be reset such that the iterator can be used multiple times. Initially, the iterator is empty until an element is set viaset(Object)
.
-
-
Constructor Summary
Constructors Constructor Description SingleElementIterator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Iterator<E>
iterator()
E
next()
void
remove()
void
set(E current)
Resets the element.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Method Detail
-
set
public void set(E current)
Resets the element. After this call, the iterator has one element available, which is the given element.- Parameters:
current
- The element to make available to the iterator.
-
-