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.AbstractSpreadSheetReaderWithMissingValueSupportReads 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 StringCOMMENTthe line comment start.static StringMISSING_VALUEthe 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.SpreadSheetdoRead(File file)Performs the actual reading.adams.data.io.output.SpreadSheetWritergetCorrespondingWriter()Returns, if available, the corresponding writer.protected adams.core.base.BaseRegExpgetDefaultMissingValue()Returns the default missing value to use.StringgetFormatDescription()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.InputTypegetInputType()Returns how to read the data, from a file, stream or reader.StringglobalInfo()Returns a string describing the object.static voidmain(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:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin 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:
getFormatDescriptionin interfaceadams.core.io.FileFormatHandler- Specified by:
getFormatDescriptionin interfaceadams.data.io.input.SpreadSheetReader- Specified by:
getFormatDescriptionin 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:
getFormatExtensionsin interfaceadams.core.io.FileFormatHandler- Specified by:
getFormatExtensionsin interfaceadams.data.io.input.SpreadSheetReader- Specified by:
getFormatExtensionsin 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:
getDefaultMissingValuein 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:
getInputTypein 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:
doReadin 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_INPUTto specify the input file. If the optionAbstractSpreadSheetReader.OPTION_OUTPUTis specified then the read sheet gets output as .csv files in that directory.- Parameters:
args- the command-line options to use
-
-