uk.ac.starlink.ttools
Class ColStats

java.lang.Object
  |
  +--uk.ac.starlink.ttools.ColStats

public abstract class ColStats
extends Object

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

Constructor Summary
protected ColStats(ColumnInfo colInfo)
          Constructs a new stats object.
 
Method Summary
protected abstract  void acceptDatum(Object value)
          Data are submitted to this statistics accumulator using this method.
 String getColumn()
          Returns column name.
 String getGood()
          Returns formatted number of non-blank values in accepted data.
protected abstract  long getGoodCountValue()
          Returns the number of good values in the accumulated data.
 String getMax()
          Returns formatted maximum value of accepted data.
protected abstract  Object getMaximumValue()
          Returns the maximum of the accumulated data.
 String getMean()
          Returns formatted mean value of accepted data.
protected abstract  double getMeanValue()
          Returns the mean of the accumulated data.
 String getMin()
          Returns formatted minimum value of accepted data.
protected abstract  Object getMinimumValue()
          Returns the minimum of the accumulated data.
 String getStdDev()
          Returns formatted standard deviation of accepted data.
 String getVariance()
          Returns formatted variance of accepted data.
protected abstract  double getVarianceValue()
          Returns the variance of the accumulated data.
static ColStats makeColStats(ColumnInfo info)
          Factory method which returns a new ColStats value suitable for a given ColumnInfo.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColStats

protected ColStats(ColumnInfo colInfo)
Constructs a new stats object.

Parameters:
colInfo - info on the values which will be passed to the acceptDatum(java.lang.Object) method
Method Detail

getColumn

public String getColumn()
Returns column name.

Returns:
column

getMean

public String getMean()
Returns formatted mean value of accepted data.

Returns:
mean

getVariance

public String getVariance()
Returns formatted variance of accepted data.

Returns:
variance

getStdDev

public String getStdDev()
Returns formatted standard deviation of accepted data.

Returns:
standard deviation

getMin

public String getMin()
Returns formatted minimum value of accepted data.

Returns:
minimum

getMax

public String getMax()
Returns formatted maximum value of accepted data.

Returns:
maximum

getGood

public String getGood()
Returns formatted number of non-blank values in accepted data.

Returns:
good value count

acceptDatum

protected abstract void acceptDatum(Object value)
Data are submitted to this statistics accumulator using this method.

Parameters:
value - data value to be accumulated into totals

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

protected abstract Object getMinimumValue()
Returns the minimum of the accumulated data.

Returns:
min

getMaximumValue

protected abstract Object 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

public static ColStats makeColStats(ColumnInfo info)
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

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.