Record Class CsvColumnStats

java.lang.Object
java.lang.Record
cloud.opencode.base.csv.stats.CsvColumnStats
Record Components:
column - the column name | 列名
totalCount - total number of rows | 总行数
nonBlankCount - number of non-blank values | 非空白值数量
distinctCount - number of distinct non-null values | 去重非null值数量
sum - sum of numeric values, null if none | 数值之和,无数值则为null
avg - average of numeric values, null if none | 数值平均值,无数值则为null
min - minimum numeric value, null if none | 最小数值,无数值则为null
max - maximum numeric value, null if none | 最大数值,无数值则为null

public record CsvColumnStats(String column, long totalCount, long nonBlankCount, long distinctCount, BigDecimal sum, BigDecimal avg, BigDecimal min, BigDecimal max) extends Record
CSV Column Statistics - Immutable summary of statistics for a single CSV column CSV列统计 - 单个CSV列统计摘要的不可变记录

Contains count, distinct count, and numeric aggregate values for a column. Numeric fields (sum, avg, min, max) are null when the column contains no parseable numeric values.

包含列的计数、去重计数和数值聚合值。 当列不包含可解析的数值时,数值字段(sum、avg、min、max)为null。

Since:
JDK 25, opencode-base-csv V1.0.3
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Constructor Details

    • CsvColumnStats

      public CsvColumnStats(String column, long totalCount, long nonBlankCount, long distinctCount, BigDecimal sum, BigDecimal avg, BigDecimal min, BigDecimal max)
      Creates an instance of a CsvColumnStats record class.
      Parameters:
      column - the value for the column record component
      totalCount - the value for the totalCount record component
      nonBlankCount - the value for the nonBlankCount record component
      distinctCount - the value for the distinctCount record component
      sum - the value for the sum record component
      avg - the value for the avg record component
      min - the value for the min record component
      max - the value for the max record component
  • Method Details

    • toString

      public final 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 the compare method from their corresponding wrapper classes.
      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.
    • column

      public String column()
      Returns the value of the column record component.
      Returns:
      the value of the column record component
    • totalCount

      public long totalCount()
      Returns the value of the totalCount record component.
      Returns:
      the value of the totalCount record component
    • nonBlankCount

      public long nonBlankCount()
      Returns the value of the nonBlankCount record component.
      Returns:
      the value of the nonBlankCount record component
    • distinctCount

      public long distinctCount()
      Returns the value of the distinctCount record component.
      Returns:
      the value of the distinctCount record component
    • sum

      public BigDecimal sum()
      Returns the value of the sum record component.
      Returns:
      the value of the sum record component
    • avg

      public BigDecimal avg()
      Returns the value of the avg record component.
      Returns:
      the value of the avg record component
    • min

      public BigDecimal min()
      Returns the value of the min record component.
      Returns:
      the value of the min record component
    • max

      public BigDecimal max()
      Returns the value of the max record component.
      Returns:
      the value of the max record component