Class AbstractLongIterator
java.lang.Object
com.complexible.common.primitives.AbstractLongIterator
- All Implemented Interfaces:
PeekingLongIterator,CloseableLongIterator,LongIterator,ResettableLongIterator,AutoCloseable
- Direct Known Subclasses:
AbstractSkippingLongIterator,ConstantAppendingLongIterator
public abstract class AbstractLongIterator
extends Object
implements ResettableLongIterator, PeekingLongIterator, CloseableLongIterator
A skeleton implementation of
LongIterator allowing subclasses to
concentrate of computing next elements.- Version:
- 5.1
- Author:
- Pavel Klinov
-
Field Summary
FieldsFields inherited from interface com.complexible.common.primitives.LongIterator
NO_NEXT_ELEMENT -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.complexible.common.primitives.CloseableLongIterator
close
-
Field Details
-
mNext
protected long mNext
-
-
Constructor Details
-
AbstractLongIterator
protected AbstractLongIterator() -
AbstractLongIterator
protected AbstractLongIterator(long theFirst)
-
-
Method Details
-
reset
public final void reset()- Specified by:
resetin interfaceResettableLongIterator
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceLongIterator
-
next
public final long next()- Specified by:
nextin interfaceLongIterator
-
peek
public final long peek()- Specified by:
peekin interfacePeekingLongIterator
-
endOfData
protected final long endOfData() -
computeNext
protected abstract long computeNext()Computes the next long to be returned by the iterator. The only method supposed to be implemented by subclasses. -
performReset
protected abstract void performReset()Resets the state so iteration can start over.
-