Class ColStats

java.lang.Object
uk.ac.starlink.ttools.mode.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
Author:
Mark Taylor (Starlink)
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    ColStats(uk.ac.starlink.table.ColumnInfo colInfo)
    Constructs a new stats object.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    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.
    Returns formatted number of non-blank values in accepted data.
    protected abstract long
    Returns the number of good values in the accumulated data.
    Returns formatted maximum value of accepted data.
    protected abstract Object
    Returns the maximum of the accumulated data.
    Returns formatted mean value of accepted data.
    protected abstract double
    Returns the mean of the accumulated data.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 the acceptDatum(java.lang.Object) method
  • Method Details

    • 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

      public abstract void acceptDatum(Object value)
      Data are submitted to this statistics accumulator using this method.
      Parameters:
      value - data value to be accumulated into totals
    • addStats

      public abstract void addStats(ColStats other)
      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

      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(uk.ac.starlink.table.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