Class FormatStringBuffer


  • public class FormatStringBuffer
    extends Object
    A class for formatting output similar to the C printf command.

    Some features provided by ANSI C-standard conformant printfs are not supported because of language constraints.

    Supported conversion specifiers are: 'c', 'd', 'e', 'E', 'f', 'g' (works like 'f'), 'i', 'o', 's', 'x' and 'X'.

    Supported conversion flags are: '#', '0', '-', ' ' (a space) and '+'.

    Support for conversion flag '*' is under development.

    Version:
    1.7
    Author:
    Antti S. Brax (asb@iki.fi, base implementation), Fred Long (flong(AT)skcc.org, implemented 'e', 'E' and 'g')
    Source code:
    main
    Belongs to CDK module:
    standard
    License:
    BSD
    • Constructor Detail

      • FormatStringBuffer

        public FormatStringBuffer​(String format)
        Create a new FormatStringBuffer.
        Parameters:
        format - the format string.
    • Method Detail

      • reset

        public FormatStringBuffer reset​(String format)
        Reset this FormatStringBuffer.
        Parameters:
        format - the format string.
      • reset

        public FormatStringBuffer reset()
        Reset this FormatStringBuffer with the format string given in the constructor or last call to reset(String). This is automatically called after toString().
      • toString

        public String toString()
        Get the result of the formatting. reset() is automatically called from this method.
        Overrides:
        toString in class Object