Package adams.data.spreadsheet.rowscore
Class ArrayStatistic
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.spreadsheet.rowscore.AbstractRowScore
-
- adams.data.spreadsheet.rowscore.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 Summary
Fields Modifier and Type Field Description protected Range
m_AdditionalRows
the additional rows to use for the array statistic.protected SpreadSheetColumnIndex
m_Column
the column of the cell to pick from the stats' output.protected Index
m_Row
the row of the cell to pick from the stats' output.protected AbstractArrayStatistic
m_Statistic
the row statistic to use.-
Fields inherited from class adams.data.spreadsheet.rowscore.AbstractRowScore
m_LastError
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description ArrayStatistic()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
additionalRowsTipText()
Returns the tip text for this property.String
columnTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected Double[]
doCalculateScore(SpreadSheet sheet, int rowIndex)
Performs the actual calculation of the row score.Range
getAdditionalRows()
Returns the additional rows to feed into the array statistic.SpreadSheetColumnIndex
getColumn()
Returns the cell's column to get the score from.int
getNumScores()
Returns how many score values will get generated.Index
getRow()
Returns the cell's row to get the score from.AbstractArrayStatistic
getStatistic()
Returns the row statistic in use.String
globalInfo()
Returns a string describing the object.String
rowTipText()
Returns the tip text for this property.void
setAdditionalRows(Range value)
Sets the additional rows to feed into the array statistic.void
setColumn(SpreadSheetColumnIndex value)
Sets the cell's column to get the score from.void
setRow(Index value)
Sets the cell's row to get the score from.void
setStatistic(AbstractArrayStatistic value)
Sets the row statistic to use.String
statisticTipText()
Returns the tip text for this property.-
Methods inherited from class adams.data.spreadsheet.rowscore.AbstractRowScore
calculateScore, check, getLastError, hasLastError
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Statistic
protected AbstractArrayStatistic m_Statistic
the row statistic to use.
-
m_AdditionalRows
protected Range m_AdditionalRows
the additional rows to use for the array statistic.
-
m_Column
protected SpreadSheetColumnIndex m_Column
the column of the cell to pick from the stats' output.
-
m_Row
protected Index m_Row
the row of the cell to pick from the stats' output.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
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 classAbstractRowScore
- 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 classAbstractRowScore
- Parameters:
sheet
- the spreadsheet to generate the score forrowIndex
- the row index- Returns:
- the generated score, null in case of an error
-
-