Package adams.data.conversion
Class SpreadSheetRowsToSampleData
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.conversion.AbstractConversion
-
- adams.data.conversion.SpreadSheetRowsToSampleData
-
- All Implemented Interfaces:
adams.core.AdditionalInformationHandler
,adams.core.CleanUpHandler
,adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.LenientModeSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.QuickInfoSupporter
,adams.core.ShallowCopySupporter<adams.data.conversion.AbstractConversion>
,adams.core.SizeOfHandler
,adams.core.Stoppable
,adams.data.conversion.Conversion
,Serializable
public class SpreadSheetRowsToSampleData extends adams.data.conversion.AbstractConversion implements adams.core.LenientModeSupporter
Turns spreadsheet rows into sample data.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-row-sampledata-names <adams.data.spreadsheet.SpreadSheetRowIndex> (property: rowSampleDataNames) The (optional) row that contains the sample data names. default: 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
-sampledata-names-in-header <boolean> (property: sampleDataNamesInHeader) Whether the sample data names are stored in the header. default: false
-rows-sampledata-values <adams.data.spreadsheet.SpreadSheetRowRange> (property: rowsSampleDataValues) The rows in the spreadsheet that contain the sample data values. 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
-cols-sampledata <adams.data.spreadsheet.SpreadSheetColumnRange> (property: columnsSampleData) The columns that contain sampledata. 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 '...'; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
-col-id <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: columnID) The (optional) column that contains the sample ID. default: 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; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
-lenient <boolean> (property: lenient) If enabled, then errors (e.g., due to corrupt data) will not cause exceptions. default: false
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.data.spreadsheet.SpreadSheetColumnIndex
m_ColumnID
the (optional) row with the sample ID.protected adams.data.spreadsheet.SpreadSheetColumnRange
m_ColumnsSampleData
the rows to get the sample data from.protected boolean
m_Lenient
whether to skip over errors.protected adams.data.spreadsheet.SpreadSheetRowIndex
m_RowSampleDataNames
the column with the sample data names.protected adams.data.spreadsheet.SpreadSheetRowRange
m_RowsSampleDataValues
the rows with sample data values.protected boolean
m_SampleDataNamesInHeader
whether the sample data names are in the header row.
-
Constructor Summary
Constructors Constructor Description SpreadSheetRowsToSampleData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class
accepts()
Returns the class that is accepted as input.String
columnIDTipText()
Returns the tip text for this property.String
columnsSampleDataTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected Object
doConvert()
Performs the actual conversion.Class
generates()
Returns the class that is generated as output.adams.data.spreadsheet.SpreadSheetColumnIndex
getColumnID()
Returns the (optional) column that contains the sample ID.adams.data.spreadsheet.SpreadSheetColumnRange
getColumnsSampleData()
Returns the columns with sampledata.boolean
getLenient()
Returns whether whether to skip over errors.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.adams.data.spreadsheet.SpreadSheetRowIndex
getRowSampleDataNames()
Returns the row that contains the sample data names.adams.data.spreadsheet.SpreadSheetRowRange
getRowsSampleDataValues()
Returns the rows with the sample data values.boolean
getSampleDataNamesInHeader()
Returns whether the sample data names are in the header.String
globalInfo()
Returns a string describing the object.String
lenientTipText()
Returns the tip text for this property.String
rowSampleDataNamesTipText()
Returns the tip text for this property.String
rowsSampleDataValuesTipText()
Returns the tip text for this property.String
sampleDataNamesInHeaderTipText()
Returns the tip text for this property.void
setColumnID(adams.data.spreadsheet.SpreadSheetColumnIndex value)
Sets the (optional) column that contains the sample ID.void
setColumnsSampleData(adams.data.spreadsheet.SpreadSheetColumnRange value)
Sets the columns with sampledata.void
setLenient(boolean value)
Sets whether to skip over errors.void
setRowSampleDataNames(adams.data.spreadsheet.SpreadSheetRowIndex value)
Sets the row that contains the sample data names.void
setRowsSampleDataValues(adams.data.spreadsheet.SpreadSheetRowRange value)
Sets the rows with the sample data values.void
setSampleDataNamesInHeader(boolean value)
Sets whether the wave numbers are in the header.-
Methods inherited from class adams.data.conversion.AbstractConversion
checkData, cleanUp, convert, getAdditionalInformation, getInput, getInput, getOutput, getOutput, getOwner, 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
-
-
-
-
Field Detail
-
m_RowSampleDataNames
protected adams.data.spreadsheet.SpreadSheetRowIndex m_RowSampleDataNames
the column with the sample data names.
-
m_SampleDataNamesInHeader
protected boolean m_SampleDataNamesInHeader
whether the sample data names are in the header row.
-
m_RowsSampleDataValues
protected adams.data.spreadsheet.SpreadSheetRowRange m_RowsSampleDataValues
the rows with sample data values.
-
m_ColumnsSampleData
protected adams.data.spreadsheet.SpreadSheetColumnRange m_ColumnsSampleData
the rows to get the sample data from.
-
m_ColumnID
protected adams.data.spreadsheet.SpreadSheetColumnIndex m_ColumnID
the (optional) row with the sample ID.
-
m_Lenient
protected boolean m_Lenient
whether to skip over errors.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.core.option.AbstractOptionHandler
- 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 interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.core.option.AbstractOptionHandler
-
setColumnID
public void setColumnID(adams.data.spreadsheet.SpreadSheetColumnIndex value)
Sets the (optional) column that contains the sample ID.- Parameters:
value
- the column
-
getColumnID
public adams.data.spreadsheet.SpreadSheetColumnIndex getColumnID()
Returns the (optional) column that contains the sample ID.- Returns:
- the column
-
columnIDTipText
public String columnIDTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRowSampleDataNames
public void setRowSampleDataNames(adams.data.spreadsheet.SpreadSheetRowIndex value)
Sets the row that contains the sample data names.- Parameters:
value
- the row
-
getRowSampleDataNames
public adams.data.spreadsheet.SpreadSheetRowIndex getRowSampleDataNames()
Returns the row that contains the sample data names.- Returns:
- the row
-
rowSampleDataNamesTipText
public String rowSampleDataNamesTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setSampleDataNamesInHeader
public void setSampleDataNamesInHeader(boolean value)
Sets whether the wave numbers are in the header.- Parameters:
value
- true if in header
-
getSampleDataNamesInHeader
public boolean getSampleDataNamesInHeader()
Returns whether the sample data names are in the header.- Returns:
- true if in header
-
sampleDataNamesInHeaderTipText
public String sampleDataNamesInHeaderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColumnsSampleData
public void setColumnsSampleData(adams.data.spreadsheet.SpreadSheetColumnRange value)
Sets the columns with sampledata.- Parameters:
value
- the columns
-
getColumnsSampleData
public adams.data.spreadsheet.SpreadSheetColumnRange getColumnsSampleData()
Returns the columns with sampledata.- Returns:
- the columns
-
columnsSampleDataTipText
public String columnsSampleDataTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRowsSampleDataValues
public void setRowsSampleDataValues(adams.data.spreadsheet.SpreadSheetRowRange value)
Sets the rows with the sample data values.- Parameters:
value
- the rows
-
getRowsSampleDataValues
public adams.data.spreadsheet.SpreadSheetRowRange getRowsSampleDataValues()
Returns the rows with the sample data values.- Returns:
- the rows
-
rowsSampleDataValuesTipText
public String rowsSampleDataValuesTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLenient
public void setLenient(boolean value)
Sets whether to skip over errors.- Specified by:
setLenient
in interfaceadams.core.LenientModeSupporter
- Parameters:
value
- true if to skip
-
getLenient
public boolean getLenient()
Returns whether whether to skip over errors.- Specified by:
getLenient
in interfaceadams.core.LenientModeSupporter
- Returns:
- true if to skip
-
lenientTipText
public String lenientTipText()
Returns the tip text for this property.- Specified by:
lenientTipText
in interfaceadams.core.LenientModeSupporter
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
accepts
public Class accepts()
Returns the class that is accepted as input.- Specified by:
accepts
in interfaceadams.data.conversion.Conversion
- Specified by:
accepts
in classadams.data.conversion.AbstractConversion
- Returns:
- the class
-
generates
public Class generates()
Returns the class that is generated as output.- Specified by:
generates
in interfaceadams.data.conversion.Conversion
- Specified by:
generates
in classadams.data.conversion.AbstractConversion
- Returns:
- the class
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceadams.core.QuickInfoSupporter
- Overrides:
getQuickInfo
in classadams.data.conversion.AbstractConversion
- Returns:
- null if no info available, otherwise short string
-
-