Package adams.data.instances
Class AbstractSpectrumBasedInstanceGenerator
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.instances.AbstractInstanceGenerator<Spectrum>
-
- adams.data.instances.AbstractSpectrumBasedInstanceGenerator
-
- All Implemented Interfaces:
adams.core.CleanUpHandler
,adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.ShallowCopySupporter<adams.data.instances.AbstractInstanceGenerator>
,adams.core.SizeOfHandler
,InstanceGeneratorWithSampleID
,adams.db.DatabaseConnectionHandler
,adams.db.DatabaseConnectionProvider
,adams.db.DatabaseConnectionUser
,adams.db.OptionalDatabaseConnectionUser
,Serializable
,Comparable
- Direct Known Subclasses:
AbstractFieldInstanceGenerator
,AbstractSpectrumInstanceGenerator
public abstract class AbstractSpectrumBasedInstanceGenerator extends adams.data.instances.AbstractInstanceGenerator<Spectrum> implements InstanceGeneratorWithSampleID
Abstract base class for schemes that turn spectra/sample data into weka.core.Instance objects.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_AddSampleID
whether to add the sample ID.protected boolean
m_LoadSampleData
whether to load the sample data if only dummy.protected adams.core.base.BaseString[]
m_Notes
the notes to add as attributes.
-
Constructor Summary
Constructors Constructor Description AbstractSpectrumBasedInstanceGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
addSampleIDTipText()
Returns the tip text for this property.protected void
checkInput(Spectrum data)
Checks the input spectrum.void
defineOptions()
Adds options to the internal list of options.boolean
getAddSampleID()
Returns whether the sample ID is added.protected adams.db.AbstractDatabaseConnection
getDefaultDatabaseConnection()
Returns the default database connection.boolean
getLoadSampleData()
Returns whether to load the sample data via the sample ID if only dummy report available.adams.core.base.BaseString[]
getNotes()
Returns the current notes to add as attributes.String
loadSampleDataTipText()
Returns the tip text for this property.String
notesTipText()
Returns the tip text for this property.protected void
postProcessHeader(Spectrum data)
Adds IDs, notes, additional fields to header.protected weka.core.Instance
postProcessOutput(Spectrum data, weka.core.Instance inst)
Adds the IDs, notes, additional fields to the data.void
setAddSampleID(boolean value)
Sets whether the sample ID is added to the data or not.void
setLoadSampleData(boolean value)
Sets whether to load the sample data via the sample ID if only dummy report available.void
setNotes(adams.core.base.BaseString[] value)
Sets the notes to add as attributes.-
Methods inherited from class adams.data.instances.AbstractInstanceGenerator
addDatabaseIDTipText, checkHeader, checkSetup, cleanUp, compareTo, destroy, equals, forCommandLine, forName, generate, generateHeader, generateOutput, getAddDatabaseID, getDatabaseConnection, getGenerators, getOffline, getOutputHeader, getTolerateHeaderChanges, initialize, interpretePosition, offlineTipText, reset, setAddDatabaseID, setDatabaseConnection, setOffline, setTolerateHeaderChanges, shallowCopy, shallowCopy, tolerateHeaderChangesTipText
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.data.instances.AbstractInstanceGenerator<Spectrum>
-
getDefaultDatabaseConnection
protected adams.db.AbstractDatabaseConnection getDefaultDatabaseConnection()
Returns the default database connection.- Specified by:
getDefaultDatabaseConnection
in classadams.data.instances.AbstractInstanceGenerator<Spectrum>
- Returns:
- the default database connection
-
setAddSampleID
public void setAddSampleID(boolean value)
Sets whether the sample ID is added to the data or not.- Specified by:
setAddSampleID
in interfaceInstanceGeneratorWithSampleID
- Parameters:
value
- true if sample ID should be added
-
getAddSampleID
public boolean getAddSampleID()
Returns whether the sample ID is added.- Specified by:
getAddSampleID
in interfaceInstanceGeneratorWithSampleID
- Returns:
- true if sample ID is added
-
addSampleIDTipText
public String addSampleIDTipText()
Returns the tip text for this property.- Specified by:
addSampleIDTipText
in interfaceInstanceGeneratorWithSampleID
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNotes
public void setNotes(adams.core.base.BaseString[] value)
Sets the notes to add as attributes.- Parameters:
value
- the notes prefixes, e.g., "PROCESS INFORMATION"
-
getNotes
public adams.core.base.BaseString[] getNotes()
Returns the current notes to add as attributes.- Returns:
- the notes prefixes, e.g., "PROCESS INFORMATION"
-
notesTipText
public String notesTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setLoadSampleData
public void setLoadSampleData(boolean value)
Sets whether to load the sample data via the sample ID if only dummy report available.- Parameters:
value
- true if the sample data should be retrieved if only dummy report available
-
getLoadSampleData
public boolean getLoadSampleData()
Returns whether to load the sample data via the sample ID if only dummy report available.- Returns:
- true if the sample data should be retrieved if only dummy report available
-
loadSampleDataTipText
public String loadSampleDataTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
checkInput
protected void checkInput(Spectrum data)
Checks the input spectrum.
The default implementation only checks whether there is any data set and loads missing sample data via the sample ID if requested.- Overrides:
checkInput
in classadams.data.instances.AbstractInstanceGenerator<Spectrum>
- Parameters:
data
- the data to process
-
postProcessHeader
protected void postProcessHeader(Spectrum data)
Adds IDs, notes, additional fields to header.- Overrides:
postProcessHeader
in classadams.data.instances.AbstractInstanceGenerator<Spectrum>
- Parameters:
data
- the input data
-
postProcessOutput
protected weka.core.Instance postProcessOutput(Spectrum data, weka.core.Instance inst)
Adds the IDs, notes, additional fields to the data.- Overrides:
postProcessOutput
in classadams.data.instances.AbstractInstanceGenerator<Spectrum>
- Parameters:
data
- the input datainst
- the generated instance- Returns:
- the processed instance
-
-