java.lang.Object
java.lang.Record
org.apache.lucene.document.NearestNeighbor.Cell
- Record Components:
distanceSortKey
- The closest distance from a point in this cell to the query point, computed as a sort key throughSloppyMath.haversinSortKey(double, double, double, double)
. Note that this is an approximation to the closest distance, and there could be a point in the cell that is closer.
- All Implemented Interfaces:
Comparable<NearestNeighbor.Cell>
- Enclosing class:
NearestNeighbor
static record NearestNeighbor.Cell(PointValues.PointTree index, int readerIndex, byte[] minPacked, byte[] maxPacked, double distanceSortKey)
extends Record
implements Comparable<NearestNeighbor.Cell>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final double
The field for thedistanceSortKey
record component.private final PointValues.PointTree
The field for theindex
record component.private final byte[]
The field for themaxPacked
record component.private final byte[]
The field for theminPacked
record component.private final int
The field for thereaderIndex
record component. -
Constructor Summary
ConstructorsConstructorDescriptionCell
(PointValues.PointTree index, int readerIndex, byte[] minPacked, byte[] maxPacked, double distanceSortKey) Creates an instance of aCell
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(NearestNeighbor.Cell other) double
Returns the value of thedistanceSortKey
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.index()
Returns the value of theindex
record component.byte[]
Returns the value of themaxPacked
record component.byte[]
Returns the value of theminPacked
record component.int
Returns the value of thereaderIndex
record component.toString()
Returns a string representation of this record class.
-
Field Details
-
index
The field for theindex
record component. -
readerIndex
private final int readerIndexThe field for thereaderIndex
record component. -
minPacked
private final byte[] minPackedThe field for theminPacked
record component. -
maxPacked
private final byte[] maxPackedThe field for themaxPacked
record component. -
distanceSortKey
private final double distanceSortKeyThe field for thedistanceSortKey
record component.
-
-
Constructor Details
-
Cell
Cell(PointValues.PointTree index, int readerIndex, byte[] minPacked, byte[] maxPacked, double distanceSortKey) Creates an instance of aCell
record class.- Parameters:
index
- the value for theindex
record componentreaderIndex
- the value for thereaderIndex
record componentminPacked
- the value for theminPacked
record componentmaxPacked
- the value for themaxPacked
record componentdistanceSortKey
- the value for thedistanceSortKey
record component
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<NearestNeighbor.Cell>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
index
Returns the value of theindex
record component.- Returns:
- the value of the
index
record component
-
readerIndex
public int readerIndex()Returns the value of thereaderIndex
record component.- Returns:
- the value of the
readerIndex
record component
-
minPacked
public byte[] minPacked()Returns the value of theminPacked
record component.- Returns:
- the value of the
minPacked
record component
-
maxPacked
public byte[] maxPacked()Returns the value of themaxPacked
record component.- Returns:
- the value of the
maxPacked
record component
-
distanceSortKey
public double distanceSortKey()Returns the value of thedistanceSortKey
record component.- Returns:
- the value of the
distanceSortKey
record component
-