Module org.elasticsearch.server
Record Class InternalCentroid.ShapeData
java.lang.Object
java.lang.Record
org.elasticsearch.search.aggregations.metrics.InternalCentroid.ShapeData
- Enclosing class:
InternalCentroid
public static record InternalCentroid.ShapeData(double firstWeightedSum, double secondWeightedSum, double totalWeight, DimensionalShapeType shapeType)
extends Record
Holds the raw weighted sums and dimensional shape type needed for correct cross-shard reduction
of shape centroids. This is
null for geo_point centroids and for results from old nodes,
avoiding any memory overhead in the common geo_point case.-
Constructor Summary
ConstructorsConstructorDescriptionShapeData(double firstWeightedSum, double secondWeightedSum, double totalWeight, DimensionalShapeType shapeType) Creates an instance of aShapeDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.doubleReturns the value of thefirstWeightedSumrecord component.final inthashCode()Returns a hash code value for this object.doubleReturns the value of thesecondWeightedSumrecord component.Returns the value of theshapeTyperecord component.final StringtoString()Returns a string representation of this record class.doubleReturns the value of thetotalWeightrecord component.
-
Constructor Details
-
ShapeData
public ShapeData(double firstWeightedSum, double secondWeightedSum, double totalWeight, DimensionalShapeType shapeType) Creates an instance of aShapeDatarecord class.- Parameters:
firstWeightedSum- the value for thefirstWeightedSumrecord componentsecondWeightedSum- the value for thesecondWeightedSumrecord componenttotalWeight- the value for thetotalWeightrecord componentshapeType- the value for theshapeTyperecord component
-
-
Method Details
-
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 '=='. -
firstWeightedSum
public double firstWeightedSum()Returns the value of thefirstWeightedSumrecord component.- Returns:
- the value of the
firstWeightedSumrecord component
-
secondWeightedSum
public double secondWeightedSum()Returns the value of thesecondWeightedSumrecord component.- Returns:
- the value of the
secondWeightedSumrecord component
-
totalWeight
public double totalWeight()Returns the value of thetotalWeightrecord component.- Returns:
- the value of the
totalWeightrecord component
-
shapeType
Returns the value of theshapeTyperecord component.- Returns:
- the value of the
shapeTyperecord component
-