Package org.apache.lucene.index
Class KnnGraphValues
- java.lang.Object
-
- org.apache.lucene.index.KnnGraphValues
-
-
Field Summary
Fields Modifier and Type Field Description static KnnGraphValues
EMPTY
Empty graph value
-
Constructor Summary
Constructors Modifier Constructor Description protected
KnnGraphValues()
Sole constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract int
nextNeighbor()
Iterates over the neighbor list.abstract void
seek(int target)
Move the pointer to exactlytarget
, the id of a node in the graph.abstract int
size()
Returns the number of nodes in the graph
-
-
-
Field Detail
-
EMPTY
public static KnnGraphValues EMPTY
Empty graph value
-
-
Method Detail
-
seek
public abstract void seek(int target) throws IOException
Move the pointer to exactlytarget
, the id of a node in the graph. After this method returns, callnextNeighbor()
to return successive (ordered) connected node ordinals.- Parameters:
target
- must be a valid node in the graph, ie. ≥ 0 and <VectorValues.size()
.- Throws:
IOException
-
size
public abstract int size()
Returns the number of nodes in the graph
-
nextNeighbor
public abstract int nextNeighbor() throws IOException
Iterates over the neighbor list. It is illegal to call this method after it returns NO_MORE_DOCS without callingseek(int)
, which resets the iterator.- Returns:
- a node ordinal in the graph, or NO_MORE_DOCS if the iteration is complete.
- Throws:
IOException
-
-