Class SimpleFormat

java.lang.Object
com.google.javascript.jscomp.base.format.SimpleFormat

public final class SimpleFormat extends 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).

TODO: b/384760309 - replace with standard String.format

  • Method Details

    • format

      public static String format(String format, 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.