Package adams.data.io.output
Class TsvSpreadSheetWriter
-
- All Implemented Interfaces:
AdditionalInformationHandler
,Destroyable
,GlobalInfoSupporter
,EncodingSupporter
,LoggingLevelHandler
,LoggingSupporter
,LocaleSupporter
,OptionHandlingLocaleSupporter
,OptionHandler
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,AppendableSpreadSheetWriter
,IncrementalSpreadSheetWriter
,NoHeaderSpreadSheetWriter
,SpreadSheetWriter
,SpreadSheetWriterWithFormulaSupport
,Serializable
public class TsvSpreadSheetWriter extends CsvSpreadSheetWriter
Writes TSV (tab-separated values) files,
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-missing <java.lang.String> (property: missingValue) The placeholder for missing values. default:
-locale <java.util.Locale> (property: locale) The locale to use for formatting the numbers. default: Default
-number-format <java.lang.String> (property: numberFormat) The format for the numbers (see java.text.DecimalFormat), use empty string for default 'double' output. default:
-encoding <adams.core.base.BaseCharset> (property: encoding) The type of encoding to use when writing using a writer, use empty string for default. default: Default
-comment <java.lang.String> (property: comment) The string denoting the start of a line comment (comments can only precede header row). default: #
-output-comments <boolean> (property: outputComments) If enabled, any available comments are output before the actual data (using the 'comment' prefix). default: true
-output-as-displayed <boolean> (property: outputAsDisplayed) If enabled, cells are output as displayed, ie, results of formulas instead of the formulas. default: false
-no-header <boolean> (property: noHeader) If enabled, no header is output. default: false
-check-file-exists <boolean> (property: checkFileExists) If enabled, it is checked each time whether the file exists; expensive test if processing only one row at a time. default: false
-appending <boolean> (property: appending) If enabled, multiple spreadsheets with the same structure can be written to the same file. default: false
-keep-existing <boolean> (property: keepExisting) If enabled, any output file that exists when the writer is executed for the first time won't get replaced with the current header; useful when outputting data in multiple locations in the flow, but one needs to be cautious as to not stored mixed content (eg varying number of columns, etc). default: false
-quote-char <java.lang.String> (property: quoteCharacter) The character to use for surrounding text cells. default: \"
-separator <java.lang.String> (property: separator) The separator to use for the columns; use '\t' for tab. default: \\t
-new-line <java.lang.String> (property: newLine) The newline character(s) to use for the columns; use '\r' for carriage return and '\n' for line feed; Linux/Unix use '\n', Windows uses '\r\n' and old Macs use '\r'. default: \\n
-always-quote-text <boolean> (property: alwaysQuoteText) If enabled, text/formula cells always get surrounded by double quotes. default: false
-escape-special-chars <boolean> (property: escapeSpecialChars) If enabled, special characters get escaped with a backslash: \\, \', \t, \n, \r, \" default: false
-date-format <adams.data.DateFormatString> (property: dateFormat) The format for dates. default: yyyy-MM-dd more: http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
-datetime-format <adams.data.DateFormatString> (property: dateTimeFormat) The format for date/times. default: yyyy-MM-dd HH:mm:ss more: http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
-datetimemsec-format <adams.data.DateFormatString> (property: dateTimeMsecFormat) The format for date/time msecs. default: yyyy-MM-dd HH:mm:ss.SSS more: http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
-time-format <adams.data.DateFormatString> (property: timeFormat) The format for times. default: HH:mm:ss more: http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
-timemsec-format <adams.data.DateFormatString> (property: timeMsecFormat) The format for times with milli-seconds. default: HH:mm:ss.SSS more: http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
-time-zone <java.util.TimeZone> (property: timeZone) The time zone to use for interpreting dates/times; default is the system-wide defined one.
- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class adams.data.io.output.AbstractSpreadSheetWriter
AbstractSpreadSheetWriter.OutputType
-
-
Field Summary
-
Fields inherited from class adams.data.io.output.CsvSpreadSheetWriter
m_AlwaysQuoteText, m_Appending, m_CheckFileExists, m_Comment, m_DateFormat, m_DateFormatter, m_DateTimeFormat, m_DateTimeFormatter, m_DateTimeMsecFormat, m_DateTimeMsecFormatter, m_EscapeSpecialChars, m_FileExists, m_Header, m_IsAppending, m_KeepExisting, m_NewLine, m_NoHeader, m_OutputAsDisplayed, m_OutputComments, m_QuoteCharacter, m_Separator, m_TimeFormat, m_TimeFormatter, m_TimeMsecFormat, m_TimeMsecFormatter, m_TimeZone
-
Fields inherited from class adams.data.io.output.AbstractFormattedSpreadSheetWriter
m_Formatter, m_Locale, m_NumberFormat
-
Fields inherited from class adams.data.io.output.AbstractSpreadSheetWriterWithMissingValueSupport
m_MissingValue
-
Fields inherited from class adams.data.io.output.AbstractSpreadSheetWriter
m_Encoding, m_Stopped
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description TsvSpreadSheetWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SpreadSheetReader
getCorrespondingReader()
Returns, if available, the corresponding reader.protected String
getDefaultSeparator()
Returns the default separator.String
getFormatDescription()
Returns a string describing the format (used in the file chooser).String[]
getFormatExtensions()
Returns the extension(s) of the format.String
globalInfo()
Returns a string describing the object.-
Methods inherited from class adams.data.io.output.CsvSpreadSheetWriter
alwaysQuoteTextTipText, appendingTipText, canAppend, checkFileExists, checkFileExistsTipText, commentTipText, dateFormatTipText, dateTimeFormatTipText, dateTimeMsecFormatTipText, defineOptions, doWrite, doWrite, doWriteHeader, escapeSpecialCharsTipText, getAlwaysQuoteText, getCheckFileExists, getComment, getDateFormat, getDateFormatter, getDateTimeFormat, getDateTimeFormatter, getDateTimeMsecFormat, getDateTimeMsecFormatter, getEscapeSpecialChars, getFileExists, getKeepExisting, getNewLine, getNoHeader, getOutputAsDisplayed, getOutputComments, getOutputType, getQuoteCharacter, getSeparator, getTimeFormat, getTimeFormatter, getTimeMsecFormat, getTimeMsecFormatter, getTimeZone, initialize, isAppending, isIncremental, keepExistingTipText, newLineTipText, noHeaderTipText, outputAsDisplayedTipText, outputCommentsTipText, preWriteFile, quoteCharacterTipText, quoteNumber, quoteString, reset, separatorTipText, setAlwaysQuoteText, setAppending, setCheckFileExists, setComment, setDateFormat, setDateTimeFormat, setDateTimeMsecFormat, setEscapeSpecialChars, setFileExists, setKeepExisting, setNewLine, setNoHeader, setOutputAsDisplayed, setOutputComments, setQuoteCharacter, setSeparator, setTimeFormat, setTimeMsecFormat, setTimeZone, supportsCompressedOutput, timeFormatTipText, timeMsecFormatTipText, timeZoneTipText, write, write, write, write, writeHeader
-
Methods inherited from class adams.data.io.output.AbstractFormattedSpreadSheetWriter
format, getDefaultNumberFormat, getDefaultUseSimpleNumberFormat, getLocale, getNumberFormat, localeTipText, numberFormatTipText, setLocale, setNumberFormat
-
Methods inherited from class adams.data.io.output.AbstractSpreadSheetWriterWithMissingValueSupport
getDefaultMissingValue, getMissingValue, missingValueTipText, setMissingValue
-
Methods inherited from class adams.data.io.output.AbstractSpreadSheetWriter
canCompress, doWrite, doWrite, encodingTipText, getAdditionalInformation, getDefaultFormatExtension, getEncoding, getWriters, isStopped, setEncoding, stopExecution, write, write, write, write
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, 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
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
Methods inherited from interface adams.data.io.output.SpreadSheetWriter
write, write, write, write
-
Methods inherited from interface adams.core.Stoppable
stopExecution
-
Methods inherited from interface adams.core.StoppableWithFeedback
isStopped
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Description copied from class:CsvSpreadSheetWriter
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Overrides:
globalInfo
in classCsvSpreadSheetWriter
- Returns:
- a description suitable for displaying in the gui
-
getDefaultSeparator
protected String getDefaultSeparator()
Returns the default separator.- Overrides:
getDefaultSeparator
in classCsvSpreadSheetWriter
- Returns:
- the default
-
getFormatDescription
public String getFormatDescription()
Returns a string describing the format (used in the file chooser).- Specified by:
getFormatDescription
in interfaceSpreadSheetWriter
- Overrides:
getFormatDescription
in classCsvSpreadSheetWriter
- 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 interfaceSpreadSheetWriter
- Overrides:
getFormatExtensions
in classCsvSpreadSheetWriter
- Returns:
- the extension (without the dot!)
-
getCorrespondingReader
public SpreadSheetReader getCorrespondingReader()
Returns, if available, the corresponding reader.- Specified by:
getCorrespondingReader
in interfaceSpreadSheetWriter
- Overrides:
getCorrespondingReader
in classCsvSpreadSheetWriter
- Returns:
- the reader, null if none available
-
-