code: public Format[] getFormatsByArgumentIndex() {
          if (msgPattern.hasNamedArguments()) {
              throw new IllegalArgumentException(
                      "This method is not available in MessageFormat objects " +
                      "that use alphanumeric argument names.");
          }
          ArrayList<Format> list = new ArrayList<Format>();
          for (int partIndex = 0; (partIndex = nextTopLevelArgStart(partIndex)) >= 0;) {
              int argNumber = msgPattern.getPart(partIndex + 1).getValue();
              while (argNumber >= list.size()) {
                  list.add(null);
              }
              list.set(argNumber, cachedFormatters == null ? null : cachedFormatters.get(partIndex));
          }
          return list.toArray(new Format[list.size()]);
      }
docs: Returns the Format objects used for the values passed into
  <code>format</code> methods or returned from <code>parse</code>
  methods. The indices of elements in the returned array
  correspond to the argument indices used in the previously set
  pattern string.
  The order of formats in the returned array thus corresponds to
  the order of elements in 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 an argument index is used for more than one format element
  in the pattern string, then the format used for the last such
  format element is returned in the array. If an argument index
  is not used for any format element in the pattern string, then
  null is returned in the array.
  
  This method is only supported when exclusively numbers are used for
  argument names. Otherwise an IllegalArgumentException is thrown.
  
  @return the formats used for the arguments within the pattern
  @throws IllegalArgumentException if this format uses named arguments