Class ArrayStatistic

  • All Implemented Interfaces:
    Destroyable, ErrorProvider, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, SizeOfHandler, Serializable

    public class ArrayStatistic
    extends AbstractRowScore
    Applies the specified array statistic algorithm and returns the specified cell's value as score.
    NB: Only collects numeric values from the rows.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -statistic <adams.data.statistics.AbstractArrayStatistic> (property: statistic)
        The array statistic to use.
        default: adams.data.statistics.ArrayMean
     
    -additional-rows <adams.core.Range> (property: additionalRows)
        The additional rows to feed into the array statistic.
        default: 
        example: A range is a comma-separated list of single 1-based indices or sub-ranges of indices ('start-end'); 'inv(...)' inverts the range '...'; the following placeholders can be used as well: first, second, third, last_2, last_1, last
     
    -column <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: column)
        The column of the cell from the row statistic's output to use as score.
        default: first
        example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last
     
    -row <adams.core.Index> (property: row)
        The row of the cell from the row statistic's output to use as score.
        default: first
        example: An index is a number starting with 1; the following placeholders can be used as well: first, second, third, last_2, last_1, last
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_AdditionalRows

        protected Range m_AdditionalRows
        the additional rows to use for the array statistic.
      • m_Row

        protected Index m_Row
        the row of the cell to pick from the stats' output.
    • Constructor Detail

      • ArrayStatistic

        public ArrayStatistic()
    • Method Detail

      • setStatistic

        public void setStatistic​(AbstractArrayStatistic value)
        Sets the row statistic to use.
        Parameters:
        value - the statistic
      • getStatistic

        public AbstractArrayStatistic getStatistic()
        Returns the row statistic in use.
        Returns:
        the statistic
      • statisticTipText

        public String statisticTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setAdditionalRows

        public void setAdditionalRows​(Range value)
        Sets the additional rows to feed into the array statistic.
        Parameters:
        value - the rows
      • getAdditionalRows

        public Range getAdditionalRows()
        Returns the additional rows to feed into the array statistic.
        Returns:
        the rows
      • additionalRowsTipText

        public String additionalRowsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setColumn

        public void setColumn​(SpreadSheetColumnIndex value)
        Sets the cell's column to get the score from.
        Parameters:
        value - the column
      • getColumn

        public SpreadSheetColumnIndex getColumn()
        Returns the cell's column to get the score from.
        Returns:
        the column
      • columnTipText

        public String columnTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setRow

        public void setRow​(Index value)
        Sets the cell's row to get the score from.
        Parameters:
        value - the row
      • getRow

        public Index getRow()
        Returns the cell's row to get the score from.
        Returns:
        the row
      • rowTipText

        public String rowTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getNumScores

        public int getNumScores()
        Returns how many score values will get generated.
        Specified by:
        getNumScores in class AbstractRowScore
        Returns:
        the number of scores
      • doCalculateScore

        protected Double[] doCalculateScore​(SpreadSheet sheet,
                                            int rowIndex)
        Performs the actual calculation of the row score.
        Specified by:
        doCalculateScore in class AbstractRowScore
        Parameters:
        sheet - the spreadsheet to generate the score for
        rowIndex - the row index
        Returns:
        the generated score, null in case of an error