Package adams.data.io.input
Class AbstractThreeWayDataReader
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.input.AbstractDataContainerReader<ThreeWayData>
-
- adams.data.io.input.AbstractThreeWayDataReader
-
- All Implemented Interfaces:
adams.core.AdditionalInformationHandler,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.DataContainerReader>,adams.core.SizeOfHandler,adams.core.Stoppable,adams.data.io.input.DataContainerReader<ThreeWayData>,Serializable,Comparable
- Direct Known Subclasses:
ExtractIdAndTypeThreeWayDataReader,FitsLibsReader,SimpleEEMReader,SimpleXYZReader
public abstract class AbstractThreeWayDataReader extends adams.data.io.input.AbstractDataContainerReader<ThreeWayData> implements adams.core.Stoppable
Abstract ancestor for readers that read files in various formats and turn them into three way data structures.- Version:
- $Revision: 2332 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringm_Formatthe form of this data.protected Stringm_Instrumentthe instrument this data is from.protected booleanm_KeepFormatwhether to not override the format obtained from the file.protected booleanm_Stoppedwhether reading was stopped.protected booleanm_UseAbsoluteSourcewhether to use absolute filename for the source report field or just the file's name.
-
Constructor Summary
Constructors Constructor Description AbstractThreeWayDataReader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckData()Hook method for checking the data.protected adams.data.report.ReportcreateDummyReport(ThreeWayData cont)Creates a dummy report.voiddefineOptions()Adds options to the internal list of options.StringformatTipText()Returns the tip text for this property.protected StringgetDefaultFormat()Returns the default format of the spectra.protected StringgetDefaultInstrument()Returns the default instrument of the spectra.protected booleangetDefaultKeepFormat()Returns the default for keeping the format.protected booleangetDefaultUseAbsoluteSource()Returns the default for using absolute source filename.StringgetFormat()Returns the format string of the data.StringgetInstrument()Returns the instrument's name.booleangetKeepFormat()Returns whether to keep the format obtained from the file.static String[]getReaders()Returns a list with classnames of readers.booleangetUseAbsoluteSource()Returns whether to use absolute source filename rather than just name.StringinstrumentTipText()Returns the tip text for this property.StringkeepFormatTipText()Returns the tip text for this property.protected voidpostProcessData()Performs some post-processing.voidsetFormat(String value)Sets the format string of the data (always converted to upper case).voidsetInstrument(String value)Sets the instrument's name.voidsetKeepFormat(boolean value)Sets whether to keep the format obtained from the file.voidsetUseAbsoluteSource(boolean value)Sets whether to use absolute source filename rather than just name.voidstopExecution()Stops the execution.StringuseAbsoluteSourceTipText()Returns the tip text for this property.-
Methods inherited from class adams.data.io.input.AbstractDataContainerReader
cleanUp, compareTo, createDummyReportTipText, destroy, doRead, equals, getAdditionalInformation, getCreateDummyReport, getDefaultFormatExtension, getFormatDescription, getFormatExtensions, getInput, initialize, inputTipText, isInputFile, read, readData, reset, setCreateDummyReport, setInput, shallowCopy, shallowCopy
-
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_Instrument
protected String m_Instrument
the instrument this data is from.
-
m_Format
protected String m_Format
the form of this data.
-
m_KeepFormat
protected boolean m_KeepFormat
whether to not override the format obtained from the file.
-
m_UseAbsoluteSource
protected boolean m_UseAbsoluteSource
whether to use absolute filename for the source report field or just the file's name.
-
m_Stopped
protected boolean m_Stopped
whether reading was stopped.
-
-
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.AbstractDataContainerReader<ThreeWayData>
-
getDefaultInstrument
protected String getDefaultInstrument()
Returns the default instrument of the spectra.- Returns:
- the default
-
getDefaultFormat
protected String getDefaultFormat()
Returns the default format of the spectra.- Returns:
- the default
-
getDefaultKeepFormat
protected boolean getDefaultKeepFormat()
Returns the default for keeping the format.- Returns:
- the default
-
getDefaultUseAbsoluteSource
protected boolean getDefaultUseAbsoluteSource()
Returns the default for using absolute source filename.- Returns:
- the default
-
setInstrument
public void setInstrument(String value)
Sets the instrument's name.- Parameters:
value- the name
-
getInstrument
public String getInstrument()
Returns the instrument's name.- Returns:
- the name
-
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.
-
setFormat
public void setFormat(String value)
Sets the format string of the data (always converted to upper case). Use null to set default format.- Parameters:
value- the format
-
getFormat
public String getFormat()
Returns the format string of the data.- 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.
-
setKeepFormat
public void setKeepFormat(boolean value)
Sets whether to keep the format obtained from the file.- Parameters:
value- true if to keep format
-
getKeepFormat
public boolean getKeepFormat()
Returns whether to keep the format obtained from the file.- Returns:
- true if to keep format
-
keepFormatTipText
public String keepFormatTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setUseAbsoluteSource
public void setUseAbsoluteSource(boolean value)
Sets whether to use absolute source filename rather than just name.- Parameters:
value- true if to use absolute source
-
getUseAbsoluteSource
public boolean getUseAbsoluteSource()
Returns whether to use absolute source filename rather than just name.- Returns:
- true if to use absolute source
-
useAbsoluteSourceTipText
public String useAbsoluteSourceTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
checkData
protected void checkData()
Hook method for checking the data.- Overrides:
checkDatain classadams.data.io.input.AbstractDataContainerReader<ThreeWayData>
-
createDummyReport
protected adams.data.report.Report createDummyReport(ThreeWayData cont)
Creates a dummy report.- Overrides:
createDummyReportin classadams.data.io.input.AbstractDataContainerReader<ThreeWayData>- Parameters:
cont- the data container the dummy is for- Returns:
- the dummy report or null
- See Also:
AbstractDataContainerReader.m_CreateDummyReport,postProcessData()
-
postProcessData
protected void postProcessData()
Performs some post-processing.- Overrides:
postProcessDatain classadams.data.io.input.AbstractDataContainerReader<ThreeWayData>
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecutionin interfaceadams.core.Stoppable
-
getReaders
public static String[] getReaders()
Returns a list with classnames of readers.- Returns:
- the reader classnames
-
-