Class PrimitiveLongCollections.PrimitiveLongBaseIterator
- java.lang.Object
-
- org.neo4j.graphalgo.core.utils.collection.primitive.PrimitiveLongCollections.PrimitiveLongBaseIterator
-
- All Implemented Interfaces:
PrimitiveLongIterator
- Direct Known Subclasses:
PrimitiveLongCollections.PrimitiveLongConcatingIterator
,PrimitiveLongCollections.PrimitiveLongFilteringIterator
,PrimitiveLongCollections.PrimitiveLongRangeIterator
- Enclosing class:
- PrimitiveLongCollections
public abstract static class PrimitiveLongCollections.PrimitiveLongBaseIterator extends java.lang.Object implements PrimitiveLongIterator
Base iterator for simpler implementations ofPrimitiveLongIterator
s.
-
-
Field Summary
Fields Modifier and Type Field Description protected long
next
-
Constructor Summary
Constructors Constructor Description PrimitiveLongBaseIterator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract boolean
fetchNext()
Fetches the next item in this iterator.boolean
hasNext()
long
next()
protected boolean
next(long nextItem)
Called from inside an implementation offetchNext()
if a next item was found.
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacePrimitiveLongIterator
-
next
public long next()
- Specified by:
next
in interfacePrimitiveLongIterator
-
fetchNext
protected abstract boolean fetchNext()
Fetches the next item in this iterator. Returns whether or not a next item was found. If a next item was found, that value must have been set inside the implementation of this method usingnext(long)
.
-
next
protected boolean next(long nextItem)
Called from inside an implementation offetchNext()
if a next item was found. This method returnstrue
so that it can be used in short-hand conditionals (TODO what are they called?), like:protected boolean fetchNext() { return source.hasNext() ? next( source.next() ) : false; }
- Parameters:
nextItem
- the next item found.
-
-