Package adams.data.io.input
Class GnuplotSpreadSheetReader
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.input.AbstractSpreadSheetReader
-
- adams.data.io.input.AbstractSpreadSheetReaderWithMissingValueSupport
-
- adams.data.io.input.GnuplotSpreadSheetReader
-
- All Implemented Interfaces:
adams.core.AdditionalInformationHandler
,adams.core.Destroyable
,adams.core.ErrorProvider
,adams.core.GlobalInfoSupporter
,adams.core.io.EncodingSupporter
,adams.core.io.FileFormatHandler
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.SizeOfHandler
,adams.core.Stoppable
,adams.core.StoppableWithFeedback
,adams.data.io.input.MissingValueSpreadSheetReader
,adams.data.io.input.SpreadSheetReader
,adams.data.spreadsheet.DataRowTypeHandler
,adams.data.spreadsheet.SpreadSheetTypeHandler
,Serializable
public class GnuplotSpreadSheetReader extends adams.data.io.input.AbstractSpreadSheetReaderWithMissingValueSupport
Reads data in Gnuplot format.
Valid options are:
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-data-row-type <DENSE|SPARSE> (property: dataRowType) The type of row to use for the data. default: DENSE
-missing <java.lang.String> (property: missingValue) The placeholder for missing values. default: -999
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMMENT
the line comment start.static String
MISSING_VALUE
the default for missing values.-
Fields inherited from class adams.data.io.input.AbstractSpreadSheetReaderWithMissingValueSupport
m_MissingValue
-
-
Constructor Summary
Constructors Constructor Description GnuplotSpreadSheetReader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected adams.data.spreadsheet.SpreadSheet
doRead(File file)
Performs the actual reading.adams.data.io.output.SpreadSheetWriter
getCorrespondingWriter()
Returns, if available, the corresponding writer.protected adams.core.base.BaseRegExp
getDefaultMissingValue()
Returns the default missing value to use.String
getFormatDescription()
Returns a string describing the format (used in the file chooser).String[]
getFormatExtensions()
Returns the extension(s) of the format.protected adams.data.io.input.AbstractSpreadSheetReader.InputType
getInputType()
Returns how to read the data, from a file, stream or reader.String
globalInfo()
Returns a string describing the object.static void
main(String[] args)
Runs the reader from the command-line.-
Methods inherited from class adams.data.io.input.AbstractSpreadSheetReaderWithMissingValueSupport
defineOptions, getMissingValue, missingValueTipText, setMissingValue
-
Methods inherited from class adams.data.io.input.AbstractSpreadSheetReader
canDecompress, check, dataRowTypeTipText, doRead, doRead, encodingTipText, getAdditionalInformation, getDataRowType, getDefaultDataRowType, getDefaultFormatExtension, getDefaultSpreadSheet, getEncoding, getLastError, getReaders, getSpreadSheetType, hasLastError, initialize, isStopped, read, read, read, read, runReader, setDataRowType, setEncoding, setLastError, setSpreadSheetType, spreadSheetTypeTipText, stopExecution, supportsCompressedInput
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
COMMENT
public static final String COMMENT
the line comment start.- See Also:
- Constant Field Values
-
MISSING_VALUE
public static final String MISSING_VALUE
the default for missing values.- See Also:
- Constant Field Values
-
-
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
-
getFormatDescription
public String getFormatDescription()
Returns a string describing the format (used in the file chooser).- Specified by:
getFormatDescription
in interfaceadams.core.io.FileFormatHandler
- Specified by:
getFormatDescription
in interfaceadams.data.io.input.SpreadSheetReader
- Specified by:
getFormatDescription
in classadams.data.io.input.AbstractSpreadSheetReader
- Returns:
- a description suitable for displaying in the file chooser
-
getFormatExtensions
public String[] getFormatExtensions()
Returns the extension(s) of the format.- Specified by:
getFormatExtensions
in interfaceadams.core.io.FileFormatHandler
- Specified by:
getFormatExtensions
in interfaceadams.data.io.input.SpreadSheetReader
- Specified by:
getFormatExtensions
in classadams.data.io.input.AbstractSpreadSheetReader
- Returns:
- the extension (without the dot!)
-
getCorrespondingWriter
public adams.data.io.output.SpreadSheetWriter getCorrespondingWriter()
Returns, if available, the corresponding writer.- Returns:
- the writer, null if none available
-
getDefaultMissingValue
protected adams.core.base.BaseRegExp getDefaultMissingValue()
Returns the default missing value to use.- Overrides:
getDefaultMissingValue
in classadams.data.io.input.AbstractSpreadSheetReaderWithMissingValueSupport
- Returns:
- the default
-
getInputType
protected adams.data.io.input.AbstractSpreadSheetReader.InputType getInputType()
Returns how to read the data, from a file, stream or reader.- Specified by:
getInputType
in classadams.data.io.input.AbstractSpreadSheetReader
- Returns:
- how to read the data
-
doRead
protected adams.data.spreadsheet.SpreadSheet doRead(File file)
Performs the actual reading.- Overrides:
doRead
in classadams.data.io.input.AbstractSpreadSheetReader
- Parameters:
file
- the file to read from- Returns:
- the spreadsheet or null in case of an error
-
main
public static void main(String[] args)
Runs the reader from the command-line. Use the optionAbstractSpreadSheetReader.OPTION_INPUT
to specify the input file. If the optionAbstractSpreadSheetReader.OPTION_OUTPUT
is specified then the read sheet gets output as .csv files in that directory.- Parameters:
args
- the command-line options to use
-
-