Class AbstractIterator<T>
java.lang.Object
org.eclipse.net4j.util.collection.AbstractIterator<T>
- All Implemented Interfaces:
Iterator<T>
- Direct Known Subclasses:
AbstractCloseableIterator
,AbstractFilteredIterator
,AbstractListIterator
,ComposedIterator
An abstract base class for custom iterators that only requires to implement a single
computeNextElement()
method.- Since:
- 3.2
- Author:
- Eike Stepper
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final Object
The token to be used incomputeNextElement()
to indicate the end of the iteration. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Object
Returns the next iteration element, orEND_OF_DATA
if the end of the iteration has been reached.static <T> ListIterator<T>
empty()
final boolean
hasNext()
final T
next()
void
remove()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
END_OF_DATA
The token to be used incomputeNextElement()
to indicate the end of the iteration.
-
-
Constructor Details
-
AbstractIterator
public AbstractIterator()
-
-
Method Details
-
hasNext
public final boolean hasNext() -
next
-
remove
public void remove() -
computeNextElement
Returns the next iteration element, orEND_OF_DATA
if the end of the iteration has been reached. -
empty
- Since:
- 3.4
-