Class AbstractDataStatistic<T extends DataContainer>

    • Field Detail

      • m_Names

        protected List<String> m_Names
        contains the ordered names.
      • m_Calculated

        protected boolean m_Calculated
        indicates whether statistics have been calculated.
      • m_Data

        protected T extends DataContainer m_Data
        the underlying chromatogram.
    • Constructor Detail

      • AbstractDataStatistic

        public AbstractDataStatistic()
        Initializes the statistic.
      • AbstractDataStatistic

        public AbstractDataStatistic​(T data)
        Initializes the statistic.
        Parameters:
        data - the data to initialize with
    • Method Detail

      • globalInfo

        public abstract String globalInfo()
        Returns a string describing the object.
        Returns:
        a description suitable for displaying in the gui
      • cleanUp

        public void cleanUp()
        Cleans up data structures, frees up memory.
        Specified by:
        cleanUp in interface CleanUpHandler
      • clear

        protected void clear()
        Removes the stored content.
      • calculate

        protected void calculate()
        Re-calculates the statistics. Derived classes must override this method if they want to return anything via statisticNames() or getStatistic(String), the default implementation does nothing.
        See Also:
        statisticNames(), getStatistic(String), m_Names, m_Statistics
      • setData

        public void setData​(T value)
        Sets the data to use as basis for the calculations.
        Parameters:
        value - the data to use, can be null
      • getData

        public T getData()
        Returns the currently stored data container.
        Returns:
        the data, can be null
      • add

        public void add​(String name,
                        double value)
        Adds the name/value pair to the internal list.
        Parameters:
        name - the name of the statistic
        value - the corresponding value
      • numberToDouble

        protected double numberToDouble​(Number value)
        Returns a double primitive from the given Number. In case of null, Double.NaN is returned.
        Parameters:
        value - the number to get the double value from
        Returns:
        the double value
      • getStatistic

        public double getStatistic​(String name)
        Returns the statistical value for the given statistic name.
        Specified by:
        getStatistic in interface InformativeStatistic
        Parameters:
        name - the name of the statistical value
        Returns:
        the corresponding value
      • toString

        public String toString()
        Returns the container as string.
        Overrides:
        toString in class Object
        Returns:
        a string representation