Class ColStats


  • public abstract class ColStats
    extends java.lang.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

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void acceptDatum​(java.lang.Object value)
      Data are submitted to this statistics accumulator using this method.
      abstract void addStats​(ColStats other)
      Adds the accumulated content of a second ColStats object to this one.
      java.lang.String getColumn()
      Returns column name.
      java.lang.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.
      java.lang.String getMax()
      Returns formatted maximum value of accepted data.
      protected abstract java.lang.Object getMaximumValue()
      Returns the maximum of the accumulated data.
      java.lang.String getMean()
      Returns formatted mean value of accepted data.
      protected abstract double getMeanValue()
      Returns the mean of the accumulated data.
      java.lang.String getMin()
      Returns formatted minimum value of accepted data.
      protected abstract java.lang.Object getMinimumValue()
      Returns the minimum of the accumulated data.
      java.lang.String getStdDev()
      Returns formatted standard deviation of accepted data.
      java.lang.String getVariance()
      Returns formatted variance of accepted data.
      protected abstract double getVarianceValue()
      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 Detail

      • 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 Detail

      • getColumn

        public java.lang.String getColumn()
        Returns column name.
        Returns:
        column
      • getMean

        public java.lang.String getMean()
        Returns formatted mean value of accepted data.
        Returns:
        mean
      • getVariance

        public java.lang.String getVariance()
        Returns formatted variance of accepted data.
        Returns:
        variance
      • getStdDev

        public java.lang.String getStdDev()
        Returns formatted standard deviation of accepted data.
        Returns:
        standard deviation
      • getMin

        public java.lang.String getMin()
        Returns formatted minimum value of accepted data.
        Returns:
        minimum
      • getMax

        public java.lang.String getMax()
        Returns formatted maximum value of accepted data.
        Returns:
        maximum
      • getGood

        public java.lang.String getGood()
        Returns formatted number of non-blank values in accepted data.
        Returns:
        good value count
      • acceptDatum

        public abstract void acceptDatum​(java.lang.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 java.lang.Object getMinimumValue()
        Returns the minimum of the accumulated data.
        Returns:
        min
      • getMaximumValue

        protected abstract java.lang.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