Class ColStats
java.lang.Object
uk.ac.starlink.ttools.mode.ColStats
Accumulates statistics for the values in a given column.
This object gets treated as a bean; its properties get turned into
table columns. The property accessors (public
get* methods)
will return formatted strings based on the data which have been
submitted to the acceptDatum(Object) method.- Since:
- 16 Mar 2005
- Author:
- Mark Taylor (Starlink)
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedColStats(uk.ac.starlink.table.ColumnInfo colInfo) Constructs a new stats object. -
Method Summary
Modifier and TypeMethodDescriptionabstract voidacceptDatum(Object value) Data are submitted to this statistics accumulator using this method.abstract voidAdds the accumulated content of a second ColStats object to this one.Returns column name.getGood()Returns formatted number of non-blank values in accepted data.protected abstract longReturns the number of good values in the accumulated data.getMax()Returns formatted maximum value of accepted data.protected abstract ObjectReturns the maximum of the accumulated data.getMean()Returns formatted mean value of accepted data.protected abstract doubleReturns the mean of the accumulated data.getMin()Returns formatted minimum value of accepted data.protected abstract ObjectReturns the minimum of the accumulated data.Returns formatted standard deviation of accepted data.Returns formatted variance of accepted data.protected abstract doubleReturns the variance of the accumulated data.static ColStatsmakeColStats(uk.ac.starlink.table.ColumnInfo info) Factory method which returns a new ColStats value suitable for a given ColumnInfo.
-
Constructor Details
-
ColStats
protected ColStats(uk.ac.starlink.table.ColumnInfo colInfo) Constructs a new stats object.- Parameters:
colInfo- info on the values which will be passed to theacceptDatum(Object)method
-
-
Method Details
-
getColumn
-
getMean
-
getVariance
-
getStdDev
Returns formatted standard deviation of accepted data.- Returns:
- standard deviation
-
getMin
-
getMax
-
getGood
Returns formatted number of non-blank values in accepted data.- Returns:
- good value count
-
acceptDatum
Data are submitted to this statistics accumulator using this method.- Parameters:
value- data value to be accumulated into totals
-
addStats
Adds the accumulated content of a second ColStats object to this one.- Parameters:
other- compatible ColStats object
-
getMeanValue
protected abstract double getMeanValue()Returns the mean of the accumulated data.- Returns:
- mean
-
getVarianceValue
protected abstract double getVarianceValue()Returns the variance of the accumulated data.- Returns:
- variance
-
getMinimumValue
Returns the minimum of the accumulated data.- Returns:
- min
-
getMaximumValue
Returns the maximum of the accumulated data.- Returns:
- max
-
getGoodCountValue
protected abstract long getGoodCountValue()Returns the number of good values in the accumulated data.- Returns:
- good value count
-
makeColStats
Factory method which returns a new ColStats value suitable for a given ColumnInfo.- Parameters:
info- column description- Returns:
- ColStats object which can accumulate stats for
info
-