Class PrimitiveIntCollections.PrimitiveIntBaseIterator
- java.lang.Object
-
- org.neo4j.graphalgo.core.utils.collection.primitive.PrimitiveIntCollections.PrimitiveIntBaseIterator
-
- All Implemented Interfaces:
PrimitiveIntIterator
- Direct Known Subclasses:
PrimitiveIntCollections.PrimitiveIntConcatingIterator
,PrimitiveIntCollections.PrimitiveIntFilteringIterator
- Enclosing class:
- PrimitiveIntCollections
public abstract static class PrimitiveIntCollections.PrimitiveIntBaseIterator extends java.lang.Object implements PrimitiveIntIterator
Base iterator for simpler implementations ofPrimitiveIntIterator
s.
-
-
Constructor Summary
Constructors Constructor Description PrimitiveIntBaseIterator()
-
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()
int
next()
protected boolean
next(int nextItem)
Called from inside an implementation offetchNext()
if a next item was found.
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacePrimitiveIntIterator
-
next
public int next()
- Specified by:
next
in interfacePrimitiveIntIterator
-
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(int)
.
-
next
protected boolean next(int 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:@Override protected boolean fetchNext() { return source.hasNext() ? next( source.next() ) : false; }
- Parameters:
nextItem
- the next item found.
-
-