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 | 数值之和,无数值则为nullavg- average of numeric values, null if none | 数值平均值,无数值则为nullmin- minimum numeric value, null if none | 最小数值,无数值则为nullmax- 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 Summary
ConstructorsConstructorDescriptionCsvColumnStats(String column, long totalCount, long nonBlankCount, long distinctCount, BigDecimal sum, BigDecimal avg, BigDecimal min, BigDecimal max) Creates an instance of aCsvColumnStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionavg()Returns the value of theavgrecord component.column()Returns the value of thecolumnrecord component.longReturns the value of thedistinctCountrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.max()Returns the value of themaxrecord component.min()Returns the value of theminrecord component.longReturns the value of thenonBlankCountrecord component.sum()Returns the value of thesumrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalCountrecord component.
-
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 aCsvColumnStatsrecord class.- Parameters:
column- the value for thecolumnrecord componenttotalCount- the value for thetotalCountrecord componentnonBlankCount- the value for thenonBlankCountrecord componentdistinctCount- the value for thedistinctCountrecord componentsum- the value for thesumrecord componentavg- the value for theavgrecord componentmin- the value for theminrecord componentmax- the value for themaxrecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
column
-
totalCount
public long totalCount()Returns the value of thetotalCountrecord component.- Returns:
- the value of the
totalCountrecord component
-
nonBlankCount
public long nonBlankCount()Returns the value of thenonBlankCountrecord component.- Returns:
- the value of the
nonBlankCountrecord component
-
distinctCount
public long distinctCount()Returns the value of thedistinctCountrecord component.- Returns:
- the value of the
distinctCountrecord component
-
sum
-
avg
-
min
-
max
-