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 doubleThe field for thedistanceSortKeyrecord component.private final PointValues.PointTreeThe field for theindexrecord component.private final byte[]The field for themaxPackedrecord component.private final byte[]The field for theminPackedrecord component.private final intThe field for thereaderIndexrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionCell(PointValues.PointTree index, int readerIndex, byte[] minPacked, byte[] maxPacked, double distanceSortKey) Creates an instance of aCellrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(NearestNeighbor.Cell other) doubleReturns the value of thedistanceSortKeyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.index()Returns the value of theindexrecord component.byte[]Returns the value of themaxPackedrecord component.byte[]Returns the value of theminPackedrecord component.intReturns the value of thereaderIndexrecord component.toString()Returns a string representation of this record class.
-
Field Details
-
index
The field for theindexrecord component. -
readerIndex
private final int readerIndexThe field for thereaderIndexrecord component. -
minPacked
private final byte[] minPackedThe field for theminPackedrecord component. -
maxPacked
private final byte[] maxPackedThe field for themaxPackedrecord component. -
distanceSortKey
private final double distanceSortKeyThe field for thedistanceSortKeyrecord component.
-
-
Constructor Details
-
Cell
Cell(PointValues.PointTree index, int readerIndex, byte[] minPacked, byte[] maxPacked, double distanceSortKey) Creates an instance of aCellrecord class.- Parameters:
index- the value for theindexrecord componentreaderIndex- the value for thereaderIndexrecord componentminPacked- the value for theminPackedrecord componentmaxPacked- the value for themaxPackedrecord componentdistanceSortKey- the value for thedistanceSortKeyrecord component
-
-
Method Details
-
compareTo
- Specified by:
compareToin 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 theindexrecord component.- Returns:
- the value of the
indexrecord component
-
readerIndex
public int readerIndex()Returns the value of thereaderIndexrecord component.- Returns:
- the value of the
readerIndexrecord component
-
minPacked
public byte[] minPacked()Returns the value of theminPackedrecord component.- Returns:
- the value of the
minPackedrecord component
-
maxPacked
public byte[] maxPacked()Returns the value of themaxPackedrecord component.- Returns:
- the value of the
maxPackedrecord component
-
distanceSortKey
public double distanceSortKey()Returns the value of thedistanceSortKeyrecord component.- Returns:
- the value of the
distanceSortKeyrecord component
-