Class SimpleFormat


  • public final class SimpleFormat
    extends java.lang.Object
    This is a hacked apart version of the Apache Harmony String.format class with all parts outside of the GWT subset removed. It will work for simple format commands but does not handle I18N and doesn't handle complex formatting options such as calendar entries and hashcodes. Formats arguments according to a format string (like printf in C).

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String format​(java.lang.String format, java.lang.Object... args)
      Writes a formatted string to the output destination of the Formatter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • format

        public static java.lang.String format​(java.lang.String format,
                                              java.lang.Object... args)
        Writes a formatted string to the output destination of the Formatter.
        Parameters:
        format - a format string.
        args - the arguments list used in the format() method. If there are more arguments than those specified by the format string, then the additional arguments are ignored.
        Returns:
        this Formatter.
        Throws:
        IllegalFormatFlagsException - if the format string is illegal or incompatible with the arguments, or if fewer arguments are sent than those required by the format string, or any other illegal situation.