org.apache.poi.ss.format
Class CellFormatter

java.lang.Object
  extended by org.apache.poi.ss.format.CellFormatter
Direct Known Subclasses:
CellDateFormatter, CellElapsedFormatter, CellGeneralFormatter, CellNumberFormatter, CellTextFormatter

public abstract class CellFormatter
extends java.lang.Object

This is the abstract supertype for the various cell formatters.


Field Summary
protected  java.lang.String format
          The original specified format.
protected  java.util.Locale locale
           
 
Constructor Summary
CellFormatter(java.util.Locale locale, java.lang.String format)
          Creates a new formatter object, storing the format in format.
CellFormatter(java.lang.String format)
          Creates a new formatter object, storing the format in format.
 
Method Summary
 java.lang.String format(java.lang.Object value)
          Formats the value, returning the resulting string.
abstract  void formatValue(java.lang.StringBuffer toAppendTo, java.lang.Object value)
          Format a value according the format string.
 java.lang.String simpleFormat(java.lang.Object value)
          Formats the value in the most basic way, returning the resulting string.
abstract  void simpleValue(java.lang.StringBuffer toAppendTo, java.lang.Object value)
          Format a value according to the type, in the most basic way.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

format

protected final java.lang.String format
The original specified format.


locale

protected final java.util.Locale locale
Constructor Detail

CellFormatter

public CellFormatter(java.lang.String format)
Creates a new formatter object, storing the format in format.

Parameters:
format - The format.

CellFormatter

public CellFormatter(java.util.Locale locale,
                     java.lang.String format)
Creates a new formatter object, storing the format in format.

Parameters:
locale - The locale.
format - The format.
Method Detail

formatValue

public abstract void formatValue(java.lang.StringBuffer toAppendTo,
                                 java.lang.Object value)
Format a value according the format string.

Parameters:
toAppendTo - The buffer to append to.
value - The value to format.

simpleValue

public abstract void simpleValue(java.lang.StringBuffer toAppendTo,
                                 java.lang.Object value)
Format a value according to the type, in the most basic way.

Parameters:
toAppendTo - The buffer to append to.
value - The value to format.

format

public java.lang.String format(java.lang.Object value)
Formats the value, returning the resulting string.

Parameters:
value - The value to format.
Returns:
The value, formatted.

simpleFormat

public java.lang.String simpleFormat(java.lang.Object value)
Formats the value in the most basic way, returning the resulting string.

Parameters:
value - The value to format.
Returns:
The value, formatted.