Class AbstractIterator<T>
- java.lang.Object
-
- org.openjdk.jmc.common.collection.AbstractIterator<T>
-
- All Implemented Interfaces:
java.util.Iterator<T>
abstract class AbstractIterator<T> extends java.lang.Object implements java.util.Iterator<T>
A partial implementation of Iterator. The only method remaining to implement by a subclass isfindNext()
.Not intended for public use.
-
-
Field Summary
Fields Modifier and Type Field Description private T
next
protected T
NO_MORE_ELEMENTS
A marker object that can be returned byfindNext()
to mark the end of the iterator.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractIterator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract T
findNext()
boolean
hasNext()
T
next()
void
remove()
-
-
-
Field Detail
-
NO_MORE_ELEMENTS
protected final T NO_MORE_ELEMENTS
A marker object that can be returned byfindNext()
to mark the end of the iterator.
-
next
private T next
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<T>
-
remove
public final void remove()
- Specified by:
remove
in interfacejava.util.Iterator<T>
-
findNext
protected abstract T findNext()
- Returns:
- the next element to return by the iterator, or
NO_MORE_ELEMENTS
if there are no more elements
-
-