Module org.apache.lucene.core
Package org.apache.lucene.util.hnsw
Class HnswGraph.ArrayNodesIterator
- java.lang.Object
-
- org.apache.lucene.util.hnsw.HnswGraph.NodesIterator
-
- org.apache.lucene.util.hnsw.HnswGraph.ArrayNodesIterator
-
- 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 class HnswGraph.ArrayNodesIterator extends HnswGraph.NodesIterator
NodesIterator that accepts nodes as an integer array.
-
-
Field Summary
Fields Modifier and Type Field Description private int
cur
(package private) static HnswGraph.NodesIterator
EMPTY
private int[]
nodes
-
Fields inherited from class org.apache.lucene.util.hnsw.HnswGraph.NodesIterator
size
-
-
Constructor Summary
Constructors Constructor Description ArrayNodesIterator(int size)
Constructor for iterator based on the sizeArrayNodesIterator(int[] nodes, int size)
Constructor for iterator based on integer array representing nodes
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
consume(int[] dest)
Consume integers from the iterator and place them into the `dest` array.boolean
hasNext()
int
nextInt()
-
Methods inherited from class org.apache.lucene.util.hnsw.HnswGraph.NodesIterator
getSortedNodes, size
-
-
-
-
Field Detail
-
EMPTY
static HnswGraph.NodesIterator EMPTY
-
nodes
private final int[] nodes
-
cur
private int cur
-
-
Method Detail
-
consume
public int consume(int[] dest)
Description copied from class:HnswGraph.NodesIterator
Consume integers from the iterator and place them into the `dest` array.- Specified by:
consume
in classHnswGraph.NodesIterator
- Parameters:
dest
- where to put the integers- Returns:
- The number of integers written to `dest`
-
nextInt
public int nextInt()
-
hasNext
public boolean hasNext()
-
-