Package org.apache.lucene.util.hnsw
Class HnswGraph.NodesIterator
java.lang.Object
org.apache.lucene.util.hnsw.HnswGraph.NodesIterator
- All Implemented Interfaces:
Iterator<Integer>
,PrimitiveIterator<Integer,
,IntConsumer> PrimitiveIterator.OfInt
- Direct Known Subclasses:
HnswGraph.ArrayNodesIterator
,HnswGraph.CollectionNodesIterator
- Enclosing class:
HnswGraph
public abstract static class HnswGraph.NodesIterator
extends Object
implements 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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.PrimitiveIterator
PrimitiveIterator.OfDouble, PrimitiveIterator.OfInt, PrimitiveIterator.OfLong
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract int
consume
(int[] dest) Consume integers from the iterator and place them into the `dest` array.static int[]
getSortedNodes
(HnswGraph.NodesIterator nodesOnLevel) int
size()
The number of elements in this iterator *Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.PrimitiveIterator.OfInt
forEachRemaining, forEachRemaining, next, nextInt
-
Field Details
-
size
protected final int size
-
-
Constructor Details
-
NodesIterator
public NodesIterator(int size) Constructor for iterator based on the size
-
-
Method Details
-
size
public int size()The number of elements in this iterator * -
consume
public abstract int consume(int[] dest) Consume integers from the iterator and place them into the `dest` array.- Parameters:
dest
- where to put the integers- Returns:
- The number of integers written to `dest`
-
getSortedNodes
-