Package adams.data.conversion
Class SpreadSheetToDoubleMatrix
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.conversion.AbstractConversion
-
- adams.data.conversion.AbstractSpreadSheetToMatrix<Double>
-
- adams.data.conversion.SpreadSheetToDoubleMatrix
-
- All Implemented Interfaces:
AdditionalInformationHandler
,CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<AbstractConversion>
,SizeOfHandler
,Stoppable
,Conversion
,Serializable
public class SpreadSheetToDoubleMatrix extends AbstractSpreadSheetToMatrix<Double>
Turns a spreadsheet into a double matrix, using only the numeric columns.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-rows <adams.core.Range> (property: rows) The range of rows to use. default: first-last 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
-columns <adams.data.spreadsheet.SpreadSheetColumnRange> (property: columns) The range of columns to use. default: first-last example: A range is a comma-separated list of single 1-based indices or sub-ranges of indices ('start-end'); 'inv(...)' inverts the range '...'; column names (case-sensitive) as well as the following placeholders can be used: 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 inherited from class adams.data.conversion.AbstractSpreadSheetToMatrix
m_Columns, m_Rows
-
Fields inherited from class adams.data.conversion.AbstractConversion
m_Input, m_Output, m_Owner, m_Stopped
-
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 SpreadSheetToDoubleMatrix()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class
generates()
Returns the class that is generated as output.protected Double
getValue(SpreadSheet sheet, Row row, int col)
Returns the cell value at the specified location.String
globalInfo()
Returns a string describing the object.protected boolean
includeColumn(SpreadSheet sheet, int col)
Determines whether to include this particular column.protected Double[][]
newMatrix(int rows, int cols)
Generates a new matrix.-
Methods inherited from class adams.data.conversion.AbstractSpreadSheetToMatrix
accepts, columnsTipText, defineOptions, determineColumns, doConvert, getColumns, getRows, rowsTipText, setColumns, setRows
-
Methods inherited from class adams.data.conversion.AbstractConversion
checkData, cleanUp, convert, getAdditionalInformation, getInput, getInput, getOutput, getOutput, getOwner, getQuickInfo, reset, setInput, setOwner, shallowCopy, shallowCopy, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, 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
-
-
-
-
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
-
generates
public Class generates()
Returns the class that is generated as output.- Specified by:
generates
in interfaceConversion
- Specified by:
generates
in classAbstractConversion
- Returns:
- the class
-
newMatrix
protected Double[][] newMatrix(int rows, int cols)
Generates a new matrix.- Specified by:
newMatrix
in classAbstractSpreadSheetToMatrix<Double>
- Parameters:
rows
- the number of rowscols
- the number of columns
-
includeColumn
protected boolean includeColumn(SpreadSheet sheet, int col)
Determines whether to include this particular column.- Specified by:
includeColumn
in classAbstractSpreadSheetToMatrix<Double>
- Parameters:
sheet
- the spreadsheet to work oncol
- the column to check- Returns:
- true if to include in the matrix
-
getValue
protected Double getValue(SpreadSheet sheet, Row row, int col)
Returns the cell value at the specified location.- Specified by:
getValue
in classAbstractSpreadSheetToMatrix<Double>
- Parameters:
sheet
- the sheet to processrow
- the row to work oncol
- the column index in the row- Returns:
- the cell value
-
-