Record Class AggregatedVector

java.lang.Object
java.lang.Record
com.apple.foundationdb.async.common.AggregatedVector
Record Components:
partialCount - count aggregate to indicate how many vectors have been aggregated to form partialVector
partialVector - the vector aggregate (mostly the sum of all individual vectors)

public record AggregatedVector(int partialCount, @Nonnull Transformed<RealVector> partialVector) extends Record
A record-like class wrapping a RealVector and a count. This data structure is used to keep a running sum of many vectors in order to compute their centroid at a later time.
  • Constructor Details

    • AggregatedVector

      public AggregatedVector(int partialCount, @Nonnull Transformed<RealVector> partialVector)
      Creates an instance of a AggregatedVector record class.
      Parameters:
      partialCount - the value for the partialCount record component
      partialVector - the value for the partialVector record component
  • Method Details

    • toString

      @Nonnull public String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • partialCount

      public int partialCount()
      Returns the value of the partialCount record component.
      Returns:
      the value of the partialCount record component
    • partialVector

      @Nonnull public Transformed<RealVector> partialVector()
      Returns the value of the partialVector record component.
      Returns:
      the value of the partialVector record component