Package adams.data.conversion
Class SpreadSheetRowsToSpectra
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.conversion.AbstractConversion
-
- adams.data.conversion.SpreadSheetRowsToSpectra
-
- 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 SpreadSheetRowsToSpectra extends adams.data.conversion.AbstractConversion implements adams.core.LenientModeSupporterTurns spreadsheet rows into spectra.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-row-wave-number <adams.data.spreadsheet.SpreadSheetRowIndex> (property: rowWaveNumber) The (optional) row in the spreadsheet that contains the wavenumber information. 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
-wave-numbers-in-header <boolean> (property: waveNumbersInHeader) Whether the wave numbers are stored in the header. default: false
-wave-number-regexp <adams.core.base.BaseRegExp> (property: waveNumberRegExp) The regular expression to identify the wave number (1st group is used). default: (.*) more: https://docs.oracle.com/javase/tutorial/essential/regex/ https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html
-cols-amplitude <adams.data.spreadsheet.SpreadSheetColumnRange> (property: columnsAmplitude) The columns that contain amplitude information. 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.-rows-amplitude <adams.data.spreadsheet.SpreadSheetRowRange> (property: rowsAmplitude) The rows in the spreadsheet that contain the amplitude information. 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-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
-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.
-format <java.lang.String> (property: format) The format for the spectrum. default: NIR
-instrument <java.lang.String> (property: instrument) The instrument for the spectrum. default: unknown
-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 static StringDEFAULT_WAVENO_REGEXPprotected adams.data.spreadsheet.SpreadSheetColumnIndexm_ColumnIDthe (optional) row with the sample ID.protected adams.data.spreadsheet.SpreadSheetColumnRangem_ColumnsAmplitudethe rows to get the amplitudes from.protected adams.data.spreadsheet.SpreadSheetColumnRangem_ColumnsSampleDatathe rows to get the sample data from.protected Stringm_Formatthe format to use for the spectrum.protected Stringm_Instrumentthe instrument to use for the spectrum.protected booleanm_Lenientwhether to skip over errors.protected adams.data.spreadsheet.SpreadSheetRowIndexm_RowSampleDataNamesthe column with the sample data names.protected adams.data.spreadsheet.SpreadSheetRowRangem_RowsAmplitudethe rows with amplitudes.protected adams.data.spreadsheet.SpreadSheetRowIndexm_RowWaveNumberthe (optional) wavenumber row.protected booleanm_SampleDataNamesInHeaderwhether the sample data names are in the header row.protected adams.core.base.BaseRegExpm_WaveNumberRegExpthe regular expression to extract the wave number from the header (first group is used).protected booleanm_WaveNumbersInHeaderwhether the wavenumbers are in the header row.
-
Constructor Summary
Constructors Constructor Description SpreadSheetRowsToSpectra()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Classaccepts()Returns the class that is accepted as input.StringcolumnIDTipText()Returns the tip text for this property.StringcolumnsAmplitudeTipText()Returns the tip text for this property.StringcolumnsSampleDataTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected ObjectdoConvert()Performs the actual conversion.StringformatTipText()Returns the tip text for this property.Classgenerates()Returns the class that is generated as output.adams.data.spreadsheet.SpreadSheetColumnIndexgetColumnID()Returns the (optional) column that contains the sample ID.adams.data.spreadsheet.SpreadSheetColumnRangegetColumnsAmplitude()Returns the columns with amplitude information.adams.data.spreadsheet.SpreadSheetColumnRangegetColumnsSampleData()Returns the columns with sampledata.StringgetFormat()Returns the format to use for the spectrum.StringgetInstrument()Returns the instrument to use for the spectrum.booleangetLenient()Returns whether whether to skip over errors.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.adams.data.spreadsheet.SpreadSheetRowIndexgetRowSampleDataNames()Returns the row that contains the sample data names.adams.data.spreadsheet.SpreadSheetRowRangegetRowsAmplitude()Returns the rows with the amplitude information.adams.data.spreadsheet.SpreadSheetRowIndexgetRowWaveNumber()Returns the row with the wavenumber information.booleangetSampleDataNamesInHeader()Returns whether the sample data names are in the header.adams.core.base.BaseRegExpgetWaveNumberRegExp()Returns the regular expression to identify the wave number (1st group is used).booleangetWaveNumbersInHeader()Returns whether the wave numbers are in the header.StringglobalInfo()Returns a string describing the object.StringinstrumentTipText()Returns the tip text for this property.StringlenientTipText()Returns the tip text for this property.StringrowSampleDataNamesTipText()Returns the tip text for this property.StringrowsAmplitudeTipText()Returns the tip text for this property.StringrowWaveNumberTipText()Returns the tip text for this property.StringsampleDataNamesInHeaderTipText()Returns the tip text for this property.voidsetColumnID(adams.data.spreadsheet.SpreadSheetColumnIndex value)Sets the (optional) column that contains the sample ID.voidsetColumnsAmplitude(adams.data.spreadsheet.SpreadSheetColumnRange value)Sets the columns with amplitude information.voidsetColumnsSampleData(adams.data.spreadsheet.SpreadSheetColumnRange value)Sets the columns with sampledata.voidsetFormat(String value)Sets the format to use for the spectrum.voidsetInstrument(String value)Sets the instrument to use for the spectrum.voidsetLenient(boolean value)Sets whether to skip over errors.voidsetRowSampleDataNames(adams.data.spreadsheet.SpreadSheetRowIndex value)Sets the row that contains the sample data names.voidsetRowsAmplitude(adams.data.spreadsheet.SpreadSheetRowRange value)Sets the rows with the amplitude information.voidsetRowWaveNumber(adams.data.spreadsheet.SpreadSheetRowIndex value)Sets the row with the wavenumber information.voidsetSampleDataNamesInHeader(boolean value)Sets whether the wave numbers are in the header.voidsetWaveNumberRegExp(adams.core.base.BaseRegExp value)Sets the regular expression to identify the wave number (1st group is used).voidsetWaveNumbersInHeader(boolean value)Sets whether the wave numbers are in the header.StringwaveNumberRegExpTipText()Returns the tip text for this property.StringwaveNumbersInHeaderTipText()Returns the tip text for this property.-
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
-
DEFAULT_WAVENO_REGEXP
public static final String DEFAULT_WAVENO_REGEXP
- See Also:
- Constant Field Values
-
m_RowWaveNumber
protected adams.data.spreadsheet.SpreadSheetRowIndex m_RowWaveNumber
the (optional) wavenumber row.
-
m_WaveNumbersInHeader
protected boolean m_WaveNumbersInHeader
whether the wavenumbers are in the header row.
-
m_WaveNumberRegExp
protected adams.core.base.BaseRegExp m_WaveNumberRegExp
the regular expression to extract the wave number from the header (first group is used).
-
m_RowsAmplitude
protected adams.data.spreadsheet.SpreadSheetRowRange m_RowsAmplitude
the rows with amplitudes.
-
m_ColumnsAmplitude
protected adams.data.spreadsheet.SpreadSheetColumnRange m_ColumnsAmplitude
the rows to get the amplitudes from.
-
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_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_Format
protected String m_Format
the format to use for the spectrum.
-
m_Instrument
protected String m_Instrument
the instrument to use for the spectrum.
-
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:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin 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:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classadams.core.option.AbstractOptionHandler
-
setRowWaveNumber
public void setRowWaveNumber(adams.data.spreadsheet.SpreadSheetRowIndex value)
Sets the row with the wavenumber information.- Parameters:
value- the row
-
getRowWaveNumber
public adams.data.spreadsheet.SpreadSheetRowIndex getRowWaveNumber()
Returns the row with the wavenumber information.- Returns:
- the row
-
rowWaveNumberTipText
public String rowWaveNumberTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setWaveNumbersInHeader
public void setWaveNumbersInHeader(boolean value)
Sets whether the wave numbers are in the header.- Parameters:
value- true if in header
-
getWaveNumbersInHeader
public boolean getWaveNumbersInHeader()
Returns whether the wave numbers are in the header.- Returns:
- true if in header
-
waveNumbersInHeaderTipText
public String waveNumbersInHeaderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setWaveNumberRegExp
public void setWaveNumberRegExp(adams.core.base.BaseRegExp value)
Sets the regular expression to identify the wave number (1st group is used).- Parameters:
value- the expression
-
getWaveNumberRegExp
public adams.core.base.BaseRegExp getWaveNumberRegExp()
Returns the regular expression to identify the wave number (1st group is used).- Returns:
- the expression
-
waveNumberRegExpTipText
public String waveNumberRegExpTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRowsAmplitude
public void setRowsAmplitude(adams.data.spreadsheet.SpreadSheetRowRange value)
Sets the rows with the amplitude information.- Parameters:
value- the rows
-
getRowsAmplitude
public adams.data.spreadsheet.SpreadSheetRowRange getRowsAmplitude()
Returns the rows with the amplitude information.- Returns:
- the rows
-
rowsAmplitudeTipText
public String rowsAmplitudeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
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.
-
setColumnsAmplitude
public void setColumnsAmplitude(adams.data.spreadsheet.SpreadSheetColumnRange value)
Sets the columns with amplitude information.- Parameters:
value- the columns
-
getColumnsAmplitude
public adams.data.spreadsheet.SpreadSheetColumnRange getColumnsAmplitude()
Returns the columns with amplitude information.- Returns:
- the columns
-
columnsAmplitudeTipText
public String columnsAmplitudeTipText()
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.
-
setFormat
public void setFormat(String value)
Sets the format to use for the spectrum.- Parameters:
value- the format
-
getFormat
public String getFormat()
Returns the format to use for the spectrum.- Returns:
- the format
-
formatTipText
public String formatTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setInstrument
public void setInstrument(String value)
Sets the instrument to use for the spectrum.- Parameters:
value- the instrument
-
getInstrument
public String getInstrument()
Returns the instrument to use for the spectrum.- Returns:
- the instrument
-
instrumentTipText
public String instrumentTipText()
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:
setLenientin interfaceadams.core.LenientModeSupporter- Parameters:
value- true if to skip
-
getLenient
public boolean getLenient()
Returns whether whether to skip over errors.- Specified by:
getLenientin interfaceadams.core.LenientModeSupporter- Returns:
- true if to skip
-
lenientTipText
public String lenientTipText()
Returns the tip text for this property.- Specified by:
lenientTipTextin 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:
acceptsin interfaceadams.data.conversion.Conversion- Specified by:
acceptsin classadams.data.conversion.AbstractConversion- Returns:
- the class
-
generates
public Class generates()
Returns the class that is generated as output.- Specified by:
generatesin interfaceadams.data.conversion.Conversion- Specified by:
generatesin 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:
getQuickInfoin interfaceadams.core.QuickInfoSupporter- Overrides:
getQuickInfoin classadams.data.conversion.AbstractConversion- Returns:
- null if no info available, otherwise short string
-
-