Package org.infinispan.commons.util
Class AbstractIterator<E>
- java.lang.Object
-
- org.infinispan.commons.util.AbstractIterator<E>
-
- All Implemented Interfaces:
Iterator<E>
- Direct Known Subclasses:
ConcatIterator
,FilterIterator
public abstract class AbstractIterator<E> extends Object implements Iterator<E>
Abstract iterator that allows overriding just thegetNext()
method to implement it. This iterator works on the premise that a null value returned fromgetNext()
means that this iterator is complete. Note this iterator does not implementIterator.remove()
and is up to implementors to do so.- Since:
- 9.2
- Author:
- wburns
-
-
Constructor Summary
Constructors Constructor Description AbstractIterator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
forEachRemaining(Consumer<? super E> action)
protected abstract E
getNext()
Method to implement to provide an iterator implementation.boolean
hasNext()
E
next()
-
-
-
Method Detail
-
getNext
protected abstract E getNext()
Method to implement to provide an iterator implementation. When this method returns null, the iterator is complete.- Returns:
- the next value for the iterator to return or null for it to be complete.
-
hasNext
public boolean hasNext()
-
next
public E next()
-
-