Class NumberFormatter

java.lang.Object
ca.phon.app.formatter.NumberFormatter
All Implemented Interfaces:
Formatter<Number>

@FormatterType(Number.class) public class NumberFormatter extends Object implements Formatter<Number>
  • Field Details

    • MIN_PRECISION

      public static final String MIN_PRECISION
    • DEFAULT_MIN_PRECISION

      public final int DEFAULT_MIN_PRECISION
      See Also:
    • MAX_PRECISION

      public static final String MAX_PRECISION
    • DEFAULT_MAX_PRECISION

      public final int DEFAULT_MAX_PRECISION
      See Also:
  • Constructor Details

    • NumberFormatter

      public NumberFormatter()
  • Method Details

    • format

      public String format(Number obj)
      Description copied from interface: Formatter
      Convert the given object into a formatted String.
      Specified by:
      format in interface Formatter<Number>
      Parameters:
      obj -
      Returns:
      formatted string
    • parse

      public Number parse(String text) throws ParseException
      Description copied from interface: Formatter
      Parse the given string into a new object instance
      Specified by:
      parse in interface Formatter<Number>
      Parameters:
      text -
      Returns:
      parsed object
      Throws:
      ParseException - if there was a problem parsing the given text