Class AbstractColumnStatistic

    • Field Detail

      • m_LastError

        protected String m_LastError
        the last error that was generated.
    • Constructor Detail

      • AbstractColumnStatistic

        public AbstractColumnStatistic()
    • Method Detail

      • hasLastError

        public boolean hasLastError()
        Checks whether there was an error with the last stats generation.
        Specified by:
        hasLastError in interface ErrorProvider
        Returns:
        true if there was an error
        See Also:
        getLastError()
      • getLastError

        public String getLastError()
        Returns the last error that occurred.
        Specified by:
        getLastError in interface ErrorProvider
        Returns:
        the last error, null if none occurred
      • check

        protected String check​(SpreadSheet sheet,
                               int colIndex)
        Checks whether the spreadsheet can be handled.
        Parameters:
        sheet - the spreadsheet to check
        colIndex - the column index
        Returns:
        null if everythin ok, otherwise error message
      • createOutputHeader

        protected SpreadSheet createOutputHeader()
        Generates the header for the statistics result.
        Returns:
        the generated header
      • preVisit

        protected abstract void preVisit​(SpreadSheet sheet,
                                         int colIndex)
        Performs initialization before the cells are being visited.
        Parameters:
        sheet - the spreadsheet to generate the stats for
        colIndex - the column index
      • doVisit

        protected abstract void doVisit​(Row row,
                                        int colIndex)
        Gets called with every row in the spreadsheet for generating the stats.
        Parameters:
        row - the current row
        colIndex - the column index
      • postVisit

        protected abstract SpreadSheet postVisit​(SpreadSheet sheet,
                                                 int colIndex)
        Finishes up the stats generation after all the cells have been visited.
        Parameters:
        sheet - the spreadsheet to generate the stats for
        colIndex - the column index
        Returns:
        the generated stats
      • doGenerate

        protected SpreadSheet doGenerate​(SpreadSheet sheet,
                                         int colIndex)
        Performs the actual generation of statistics for the specified spreadsheet column.
        Parameters:
        sheet - the spreadsheet to generate the stats for
        colIndex - the column index
        Returns:
        the generated statistics, null in case of an error
      • generate

        public SpreadSheet generate​(SpreadSheet sheet,
                                    int colIndex)
        Generates statistics for the specified spreadsheet column.
        Parameters:
        sheet - the spreadsheet to generate the stats for
        colIndex - the column index
        Returns:
        the generated statistics, null in case of an error