Class IntFormatter

java.lang.Object
com.pervasive.datarush.encoding.text.IntFormatter
All Implemented Interfaces:
TokenFormatter

public class IntFormatter extends Object
A formatter representing int token values with a user-defined text format.
  • Constructor Details

    • IntFormatter

      public IntFormatter(NumberFormat format)
      Creates a formatter using the specified format. Null values are output as the empty string.
      Parameters:
      format - the output format to use
    • IntFormatter

      public IntFormatter(NumberFormat format, String nullIndicator)
      Creates a formatter using the specified format. Null values are output as the specified string.
      Parameters:
      format - the output format to use
      nullIndicator - the text value to use for null values
  • Method Details

    • setSource

      public final void setSource(ScalarValued source)
      Description copied from interface: TokenFormatter
      Sets the container holding values to be formatted. A reference to this container is held and accessed only when an formatting is requested.
      Specified by:
      setSource in interface TokenFormatter
      Parameters:
      source - the value container to format
    • format

      public final String format()
      Description copied from interface: TokenFormatter
      Formats the current value of the source as a text value.
      Specified by:
      format in interface TokenFormatter
      Returns:
      the value of the source as a string