Package org.apache.lucene.util.hnsw
Class HnswGraph.NodesIterator
- java.lang.Object
-
- org.apache.lucene.util.hnsw.HnswGraph.NodesIterator
-
- All Implemented Interfaces:
java.util.Iterator<java.lang.Integer>
,java.util.PrimitiveIterator<java.lang.Integer,java.util.function.IntConsumer>
,java.util.PrimitiveIterator.OfInt
- Enclosing class:
- HnswGraph
public static final class HnswGraph.NodesIterator extends java.lang.Object implements java.util.PrimitiveIterator.OfInt
Iterator over the graph nodes on a certain level, Iterator also provides the size – the total number of nodes to be iterated over.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
cur
(package private) static HnswGraph.NodesIterator
EMPTY
private int[]
nodes
private int
size
-
Constructor Summary
Constructors Constructor Description NodesIterator(int size)
Constructor for iterator based on the sizeNodesIterator(int[] nodes, int size)
Constructor for iterator based on the nodes array up to the size
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
int
nextInt()
int
size()
The number of elements in this iterator *
-
-
-
Field Detail
-
EMPTY
static HnswGraph.NodesIterator EMPTY
-
nodes
private final int[] nodes
-
size
private final int size
-
cur
int cur
-
-