Class CellFormatter

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

public abstract class CellFormatter extends Object
This is the abstract supertype for the various cell formatters.
Author:
Ken Arnold, Industrious Media LLC
  • Field Details

    • format

      protected final String format
      The original specified format.
    • locale

      protected final Locale locale
  • Constructor Details

    • CellFormatter

      public CellFormatter(String format)
      Creates a new formatter object, storing the format in format.
      Parameters:
      format - The format.
    • CellFormatter

      public CellFormatter(Locale locale, String format)
      Creates a new formatter object, storing the format in format.
      Parameters:
      locale - The locale.
      format - The format.
  • Method Details

    • formatValue

      public abstract void formatValue(StringBuffer toAppendTo, 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(StringBuffer toAppendTo, 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 String format(Object value)
      Formats the value, returning the resulting string.
      Parameters:
      value - The value to format.
      Returns:
      The value, formatted.
    • simpleFormat

      public String simpleFormat(Object value)
      Formats the value in the most basic way, returning the resulting string.
      Parameters:
      value - The value to format.
      Returns:
      The value, formatted.