Package adams.data.io.output
Class LatexSpreadSheetWriter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.output.AbstractSpreadSheetWriter
-
- adams.data.io.output.AbstractMultiSheetSpreadSheetWriter
-
- adams.data.io.output.AbstractMultiSheetSpreadSheetWriterWithMissingValueSupport
-
- adams.data.io.output.AbstractMultiSheetFormattedSpreadSheetWriter
-
- adams.data.io.output.LatexSpreadSheetWriter
-
- All Implemented Interfaces:
adams.core.AdditionalInformationHandler
,adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.io.EncodingSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.SizeOfHandler
,adams.core.Stoppable
,adams.core.StoppableWithFeedback
,adams.data.io.output.MultiSheetSpreadSheetWriter
,adams.data.io.output.SpreadSheetWriter
,Serializable
public class LatexSpreadSheetWriter extends adams.data.io.output.AbstractMultiSheetFormattedSpreadSheetWriter
Generates LaTeX tables from spreadsheets.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-sheet-prefix <java.lang.String> (property: sheetPrefix) The prefix for sheet names. default: Sheet
-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:
-header-bold <boolean> (property: headerBold) If enabled, the header gets output in bold face. default: false
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_HeaderBold
whether to make header bold.-
Fields inherited from class adams.data.io.output.AbstractMultiSheetFormattedSpreadSheetWriter
m_Formatter, m_Locale, m_NumberFormat
-
-
Constructor Summary
Constructors Constructor Description LatexSpreadSheetWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected boolean
doWrite(adams.data.spreadsheet.SpreadSheet[] content, Writer writer)
Performs the actual writing.protected String
escape(String s)
Turns the string into LaTeX-compliant text.adams.data.io.input.SpreadSheetReader
getCorrespondingReader()
Returns, if available, the corresponding reader.String
getFormatDescription()
Returns a string describing the format (used in the file chooser).String[]
getFormatExtensions()
Returns the extension(s) of the format.boolean
getHeaderBold()
Returns whether to make the header bold.protected adams.data.io.output.AbstractSpreadSheetWriter.OutputType
getOutputType()
Returns how the data is written.String
globalInfo()
Returns a string describing the object.String
headerBoldTipText()
Returns the tip text for this property.void
setHeaderBold(boolean value)
Sets whether to make the header bold.-
Methods inherited from class adams.data.io.output.AbstractMultiSheetFormattedSpreadSheetWriter
format, getDefaultNumberFormat, getLocale, getNumberFormat, localeTipText, numberFormatTipText, setLocale, setNumberFormat
-
Methods inherited from class adams.data.io.output.AbstractMultiSheetSpreadSheetWriterWithMissingValueSupport
getDefaultMissingValue, getMissingValue, missingValueTipText, setMissingValue
-
Methods inherited from class adams.data.io.output.AbstractMultiSheetSpreadSheetWriter
canWriteMultiple, doWrite, doWrite, doWrite, doWrite, getDefaultSheetPrefix, getSheetPrefix, setSheetPrefix, sheetPrefixTipText, write, write, write, write
-
Methods inherited from class adams.data.io.output.AbstractSpreadSheetWriter
canCompress, doWrite, encodingTipText, getAdditionalInformation, getDefaultFormatExtension, getEncoding, getWriters, initialize, isStopped, preWriteFile, reset, setEncoding, stopExecution, supportsCompressedOutput, 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.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
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
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.data.io.output.AbstractMultiSheetFormattedSpreadSheetWriter
-
setHeaderBold
public void setHeaderBold(boolean value)
Sets whether to make the header bold.- Parameters:
value
- true if bold
-
getHeaderBold
public boolean getHeaderBold()
Returns whether to make the header bold.- Returns:
- true if bold
-
headerBoldTipText
public String headerBoldTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getFormatDescription
public String getFormatDescription()
Returns a string describing the format (used in the file chooser).- Specified by:
getFormatDescription
in interfaceadams.data.io.output.SpreadSheetWriter
- Specified by:
getFormatDescription
in classadams.data.io.output.AbstractSpreadSheetWriter
- 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.data.io.output.SpreadSheetWriter
- Specified by:
getFormatExtensions
in classadams.data.io.output.AbstractSpreadSheetWriter
- Returns:
- the extension (without the dot!)
-
getCorrespondingReader
public adams.data.io.input.SpreadSheetReader getCorrespondingReader()
Returns, if available, the corresponding reader.- Returns:
- the reader, null if none available
-
getOutputType
protected adams.data.io.output.AbstractSpreadSheetWriter.OutputType getOutputType()
Returns how the data is written.- Specified by:
getOutputType
in classadams.data.io.output.AbstractSpreadSheetWriter
- Returns:
- the type
-
escape
protected String escape(String s)
Turns the string into LaTeX-compliant text.- Parameters:
s
- the string to process- Returns:
- the processed string
-
doWrite
protected boolean doWrite(adams.data.spreadsheet.SpreadSheet[] content, Writer writer)
Performs the actual writing. The caller must ensure that the writer gets closed.- Overrides:
doWrite
in classadams.data.io.output.AbstractMultiSheetSpreadSheetWriter
- Parameters:
content
- the spreadsheets to writewriter
- the writer to write the spreadsheet to- Returns:
- true if successfully written
-
-