adams.core.io
Class LatexSpreadSheetWriter

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.data.io.output.AbstractSpreadSheetWriter
              extended by adams.data.io.output.AbstractSpreadSheetWriterWithMissingValueSupport
                  extended by adams.data.io.output.AbstractFormattedSpreadSheetWriter
                      extended by adams.core.io.LatexSpreadSheetWriter
All Implemented Interfaces:
Debuggable, Destroyable, OptionHandler, SizeOfHandler, Serializable

public class LatexSpreadSheetWriter
extends AbstractFormattedSpreadSheetWriter

Generates LaTeX tables from spreadsheets.

Valid options are:

-D <int> (property: debugLevel)
    The greater the number the more additional info the scheme may output to
    the console (0 = off).
    default: 0
    minimum: 0
 
-missing <java.lang.String> (property: missingValue)
    The placeholder for missing values.
    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:
 

Version:
$Revision: 6306 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class adams.data.io.output.AbstractFormattedSpreadSheetWriter
m_Formatter, m_NumberFormat
 
Fields inherited from class adams.data.io.output.AbstractSpreadSheetWriterWithMissingValueSupport
m_MissingValue
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
LatexSpreadSheetWriter()
           
 
Method Summary
protected  boolean doWrite(SpreadSheet content, Writer writer)
          Performs the actual writing.
protected  String escape(String s)
          Turns the string into LaTeX-compliant text.
 String getFormatDescription()
          Returns a string describing the format (used in the file chooser).
 String[] getFormatExtensions()
          Returns the extension(s) of the format.
protected  boolean getUseOutputStream()
          Returns whether to write to an OutputStream rather than a Writer.
 String globalInfo()
          Returns a string describing the object.
 
Methods inherited from class adams.data.io.output.AbstractFormattedSpreadSheetWriter
defineOptions, format, getDefaultNumberFormat, getNumberFormat, numberFormatTipText, setNumberFormat
 
Methods inherited from class adams.data.io.output.AbstractSpreadSheetWriterWithMissingValueSupport
getDefaultMissingValue, getMissingValue, missingValueTipText, setMissingValue
 
Methods inherited from class adams.data.io.output.AbstractSpreadSheetWriter
doWrite, getWriters, write, write, write, write
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debug, debugLevelTipText, destroy, finishInit, getDebugLevel, getOptionManager, initialize, isDebugOn, newOptionManager, reset, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut, sizeOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LatexSpreadSheetWriter

public LatexSpreadSheetWriter()
Method Detail

globalInfo

public String globalInfo()
Returns a string describing the object.

Specified by:
globalInfo in class 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 class 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 class AbstractSpreadSheetWriter
Returns:
the extension (without the dot!)

getUseOutputStream

protected boolean getUseOutputStream()
Returns whether to write to an OutputStream rather than a Writer.

Specified by:
getUseOutputStream in class AbstractSpreadSheetWriter
Returns:
true if to write to an OutputStream

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(SpreadSheet content,
                          Writer writer)
Performs the actual writing. The caller must ensure that the writer gets closed.

Overrides:
doWrite in class AbstractSpreadSheetWriter
Parameters:
content - the spreadsheet to write
writer - the writer to write the spreadsheet to
Returns:
true if successfully written


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.