Package adams.data.spreadsheet.rowscore
Class AbstractRowScore
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.spreadsheet.rowscore.AbstractRowScore
-
- All Implemented Interfaces:
Destroyable
,ErrorProvider
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Serializable
- Direct Known Subclasses:
AbstractMetaRowScore
,ArrayStatistic
,DistanceFromConstant
,MultiRowScore
,NonMissing
,RowStatistic
,SAXDistanceFromBaseline
public abstract class AbstractRowScore extends AbstractOptionHandler implements ErrorProvider
Ancestor for algorithms that calculate a score for a spreadsheet row.- Version:
- $Revision: 9765 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_LastError
the last error that was generated.-
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 AbstractRowScore()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Double[]
calculateScore(SpreadSheet sheet, int rowIndex)
Performs the calculation of the row score(s).protected String
check(SpreadSheet sheet, int rowIndex)
Checks whether the spreadsheet can be handled.protected abstract Double[]
doCalculateScore(SpreadSheet sheet, int rowIndex)
Performs the actual calculation of the row score(s).String
getLastError()
Returns the last error that occurred.abstract int
getNumScores()
Returns how many score values will get generated.boolean
hasLastError()
Checks whether there was an error with the last stats generation.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, 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_LastError
protected String m_LastError
the last error that was generated.
-
-
Method Detail
-
hasLastError
public boolean hasLastError()
Checks whether there was an error with the last stats generation.- Specified by:
hasLastError
in interfaceErrorProvider
- Returns:
- true if there was an error
- See Also:
getLastError()
-
getLastError
public String getLastError()
Returns the last error that occurred.- Specified by:
getLastError
in interfaceErrorProvider
- Returns:
- the last error, null if none occurred
-
getNumScores
public abstract int getNumScores()
Returns how many score values will get generated.- Returns:
- the number of scores
-
check
protected String check(SpreadSheet sheet, int rowIndex)
Checks whether the spreadsheet can be handled.- Parameters:
sheet
- the spreadsheet to checkrowIndex
- the row index- Returns:
- null if everythin ok, otherwise error message
-
doCalculateScore
protected abstract Double[] doCalculateScore(SpreadSheet sheet, int rowIndex)
Performs the actual calculation of the row score(s).- Parameters:
sheet
- the spreadsheet to generate the score forrowIndex
- the row index- Returns:
- the generated score(s), null in case of an error
-
calculateScore
public Double[] calculateScore(SpreadSheet sheet, int rowIndex)
Performs the calculation of the row score(s).- Parameters:
sheet
- the spreadsheet to generate the score forrowIndex
- the row index- Returns:
- the generated score(s), null in case of an error
-
-