Package adams.data.io.output
Class AbstractFormattedSpreadSheetWriter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.output.AbstractSpreadSheetWriter
-
- adams.data.io.output.AbstractSpreadSheetWriterWithMissingValueSupport
-
- adams.data.io.output.AbstractFormattedSpreadSheetWriter
-
- All Implemented Interfaces:
AdditionalInformationHandler
,Destroyable
,GlobalInfoSupporter
,EncodingSupporter
,LoggingLevelHandler
,LoggingSupporter
,LocaleSupporter
,OptionHandlingLocaleSupporter
,OptionHandler
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,SpreadSheetWriter
,Serializable
- Direct Known Subclasses:
AutoWidthTabularSpreadSheetWriter
,CsvSpreadSheetWriter
,FixedTabularSpreadSheetWriter
public abstract class AbstractFormattedSpreadSheetWriter extends AbstractSpreadSheetWriterWithMissingValueSupport implements OptionHandlingLocaleSupporter
Ancestor for writers that format the numbers.- 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 Modifier and Type Field Description protected NumberFormat
m_Formatter
the formatter to use.protected Locale
m_Locale
the locale to use.protected String
m_NumberFormat
The format for the numbers.-
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 AbstractFormattedSpreadSheetWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected String
format(double value)
Formats the number according to the format and returns the generated textual representation.protected String
getDefaultNumberFormat()
Returns the default number format.protected boolean
getDefaultUseSimpleNumberFormat()
Returns the default for the simple number format.Locale
getLocale()
Returns the locale in use.String
getNumberFormat()
Returns the number format.String
localeTipText()
Returns the tip text for this property.String
numberFormatTipText()
Returns the tip text for this property.void
setLocale(Locale value)
Sets the locale to use.void
setNumberFormat(String value)
Sets the number format.-
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, doWrite, encodingTipText, getAdditionalInformation, getDefaultFormatExtension, getEncoding, getFormatDescription, getFormatExtensions, getOutputType, 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, globalInfo, 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
getCorrespondingReader
-
-
-
-
Field Detail
-
m_Locale
protected Locale m_Locale
the locale to use.
-
m_NumberFormat
protected String m_NumberFormat
The format for the numbers.
-
m_Formatter
protected transient NumberFormat m_Formatter
the formatter to use.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractSpreadSheetWriterWithMissingValueSupport
-
setLocale
public void setLocale(Locale value)
Sets the locale to use.- Specified by:
setLocale
in interfaceLocaleSupporter
- Parameters:
value
- the locale
-
getLocale
public Locale getLocale()
Returns the locale in use.- Specified by:
getLocale
in interfaceLocaleSupporter
- Returns:
- the locale
-
localeTipText
public String localeTipText()
Returns the tip text for this property.- Specified by:
localeTipText
in interfaceOptionHandlingLocaleSupporter
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultNumberFormat
protected String getDefaultNumberFormat()
Returns the default number format.- Returns:
- the default format
-
setNumberFormat
public void setNumberFormat(String value)
Sets the number format.- Parameters:
value
- the format
-
getNumberFormat
public String getNumberFormat()
Returns the number format.- Returns:
- the format
-
numberFormatTipText
public String numberFormatTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getDefaultUseSimpleNumberFormat
protected boolean getDefaultUseSimpleNumberFormat()
Returns the default for the simple number format.- Returns:
- the default
-
format
protected String format(double value)
Formats the number according to the format and returns the generated textual representation.- Parameters:
value
- the double value to turn into a string- Returns:
- the generated string
-
-