Package adams.data.io.input
Class AbstractSampleDataReader
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.input.AbstractReportReader<SampleData>
-
- adams.data.io.input.AbstractSampleDataReader
-
- All Implemented Interfaces:
adams.core.CleanUpHandler,adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.io.FileFormatHandler,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.ShallowCopySupporter<adams.data.io.input.AbstractReportReader>,adams.core.SizeOfHandler,adams.core.Stoppable,adams.core.StoppableWithFeedback,adams.data.io.input.ReportReader<SampleData>,SampleDataReader,adams.db.DatabaseConnectionHandler,adams.db.DatabaseConnectionProvider,adams.db.DatabaseConnectionUser,Serializable,Comparable
- Direct Known Subclasses:
MultiColumnSpreadSheetSampleDataReader,RowWiseSpreadSheetSampleDataReader,SpecLibSampleDataReader
public abstract class AbstractSampleDataReader extends adams.data.io.input.AbstractReportReader<SampleData> implements SampleDataReader, adams.db.DatabaseConnectionHandler
Ancestor for sample data readers.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.db.AbstractDatabaseConnectionm_DatabaseConnectionthe database connection in use.protected Stringm_Formatthe spectrum format to use.protected booleanm_Offlinewhether operate in offline mode, i.e., not query database.
-
Constructor Summary
Constructors Constructor Description AbstractSampleDataReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected intdetermineParentID(adams.data.report.Report report)Tries to determine the parent ID for the current report.StringformatTipText()Returns the tip text for this property.adams.db.AbstractDatabaseConnectiongetDatabaseConnection()Returns the currently used database connection object, can be null.StringgetFormat()The format of spectrum to use.booleangetOffline()Returns whether to work in offline mode, i.e., not query the database.protected SampleDataFgetSampleData()Returns the table object to use for accessing the reports.protected SpectrumFgetSpectrum()Returns the table object to use for accessing the spectra.protected voidinitialize()Initializes the members.StringofflineTipText()Returns the tip text for this property.voidsetDatabaseConnection(adams.db.AbstractDatabaseConnection value)Sets the database connection object to use.voidsetFormat(String value)Sets the format of spectrum to use.voidsetOffline(boolean value)Sets whether to work in offline mode, i.e., not query the database.-
Methods inherited from class adams.data.io.input.AbstractReportReader
checkData, cleanUp, compareTo, destroy, equals, forCommandLine, forName, getDefaultFormatExtension, getFormatDescription, getFormatExtensions, getInput, getReaders, inputTipText, isStopped, newInstance, postRead, read, readData, reset, setInput, shallowCopy, shallowCopy, stopExecution
-
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
-
-
-
-
Field Detail
-
m_Format
protected String m_Format
the spectrum format to use.
-
m_Offline
protected boolean m_Offline
whether operate in offline mode, i.e., not query database.
-
m_DatabaseConnection
protected adams.db.AbstractDatabaseConnection m_DatabaseConnection
the database connection in use.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classadams.data.io.input.AbstractReportReader<SampleData>
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classadams.core.option.AbstractOptionHandler
-
setOffline
public void setOffline(boolean value)
Sets whether to work in offline mode, i.e., not query the database.- Parameters:
value- if true then offline mode
-
getOffline
public boolean getOffline()
Returns whether to work in offline mode, i.e., not query the database.- Returns:
- true if in offline mode
-
offlineTipText
public String offlineTipText()
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 of spectrum to use.- Parameters:
value- the format
-
getFormat
public String getFormat()
The format of spectrum to use.- 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.
-
getDatabaseConnection
public adams.db.AbstractDatabaseConnection getDatabaseConnection()
Returns the currently used database connection object, can be null.- Specified by:
getDatabaseConnectionin interfaceadams.db.DatabaseConnectionProvider- Returns:
- the current object
-
setDatabaseConnection
public void setDatabaseConnection(adams.db.AbstractDatabaseConnection value)
Sets the database connection object to use.- Specified by:
setDatabaseConnectionin interfaceadams.db.DatabaseConnectionHandler- Parameters:
value- the object to use
-
getSampleData
protected SampleDataF getSampleData()
Returns the table object to use for accessing the reports.- Returns:
- the table object
-
getSpectrum
protected SpectrumF getSpectrum()
Returns the table object to use for accessing the spectra.- Returns:
- the table object
-
determineParentID
protected int determineParentID(adams.data.report.Report report)
Tries to determine the parent ID for the current report.- Specified by:
determineParentIDin classadams.data.io.input.AbstractReportReader<SampleData>- Parameters:
report- the report to determine the ID for- Returns:
- the parent database ID, -1 if it cannot be determined
-
-