Package uk.ac.starlink.ttools.mode
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(java.lang.Object)
method.- Since:
- 16 Mar 2005
- Author:
- Mark Taylor (Starlink)
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ColStats
(uk.ac.starlink.table.ColumnInfo colInfo) Constructs a new stats object. -
Method Summary
Modifier and TypeMethodDescriptionabstract void
acceptDatum
(Object value) Data are submitted to this statistics accumulator using this method.abstract void
Adds 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 long
Returns the number of good values in the accumulated data.getMax()
Returns formatted maximum value of accepted data.protected abstract Object
Returns the maximum of the accumulated data.getMean()
Returns formatted mean value of accepted data.protected abstract double
Returns the mean of the accumulated data.getMin()
Returns formatted minimum value of accepted data.protected abstract Object
Returns the minimum of the accumulated data.Returns formatted standard deviation of accepted data.Returns formatted variance of accepted data.protected abstract double
Returns the variance of the accumulated data.static ColStats
makeColStats
(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(java.lang.Object)
method
-
-
Method Details
-
getColumn
Returns column name.- Returns:
- column
-
getMean
Returns formatted mean value of accepted data.- Returns:
- mean
-
getVariance
Returns formatted variance of accepted data.- Returns:
- variance
-
getStdDev
Returns formatted standard deviation of accepted data.- Returns:
- standard deviation
-
getMin
Returns formatted minimum value of accepted data.- Returns:
- minimum
-
getMax
Returns formatted maximum value of accepted data.- Returns:
- maximum
-
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
-