Package adams.data.spreadsheet.rowscore
Class RowStatistic
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.spreadsheet.rowscore.AbstractRowScore
-
- adams.data.spreadsheet.rowscore.RowStatistic
-
- All Implemented Interfaces:
Destroyable
,ErrorProvider
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Serializable
public class RowStatistic extends AbstractRowScore
Applies the specified row statistic algorithm and returns the specified cell's value as score.
-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.spreadsheet.rowstatistic.AbstractRowStatistic> (property: statistic) The row statistic to use. default: adams.data.spreadsheet.rowstatistic.Mean
-column <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: column) The column of the cell from the row statistic's output to use as score. default: 2 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: 1 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 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 AbstractRowStatistic
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 RowStatistic()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.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.AbstractRowStatistic
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
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(AbstractRowStatistic 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 AbstractRowStatistic m_Statistic
the row statistic to use.
-
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(AbstractRowStatistic value)
Sets the row statistic to use.- Parameters:
value
- the statistic
-
getStatistic
public AbstractRowStatistic 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.
-
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
-
-