Class PrimitiveLongCollections.PrimitiveLongBaseIterator
- java.lang.Object
-
- org.neo4j.gds.core.utils.collection.primitive.PrimitiveLongCollections.PrimitiveLongBaseIterator
-
- All Implemented Interfaces:
java.util.Iterator<java.lang.Long>
,java.util.PrimitiveIterator<java.lang.Long,java.util.function.LongConsumer>
,java.util.PrimitiveIterator.OfLong
- Direct Known Subclasses:
PrimitiveLongCollections.PrimitiveLongRangeIterator
- Enclosing class:
- PrimitiveLongCollections
public abstract static class PrimitiveLongCollections.PrimitiveLongBaseIterator extends java.lang.Object implements java.util.PrimitiveIterator.OfLong
Base iterator for simpler implementations ofPrimitiveIterator.OfLong
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()
protected boolean
next(long nextItem)
Called from inside an implementation offetchNext()
if a next item was found.long
nextLong()
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<java.lang.Long>
-
nextLong
public long nextLong()
- Specified by:
nextLong
in interfacejava.util.PrimitiveIterator.OfLong
-
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.
-
-