code: public void setFormatByArgumentIndex(int argumentIndex, Format newFormat) {
          for (int j = 0; j <= maxOffset; j++) {
              if (argumentNumbers[j] == argumentIndex) {
                  formats[j] = newFormat;
              }
          }
      }
docs: Sets the format to use for the format elements within the
  previously set pattern string that use the given argument
  index.
  The argument index is part of the format element definition and
  represents an index into the <code>arguments</code> array passed
  to the <code>format</code> methods or the result array returned
  by the <code>parse</code> methods.
  <p>
  If the argument index is used for more than one format element
  in the pattern string, then the new format is used for all such
  format elements. If the argument index is not used for any format
  element in the pattern string, then the new format is ignored.
  
  @param argumentIndex the argument index for which to use the new format
  @param newFormat the new format to use
  @since 1.4