private static final int scanFormat (String pat, int index, StringBuffer buffer, Vector elts, Locale locale)
private static int scanFormat(String pat, int index, StringBuffer buffer, Vector elts, Locale locale)
  private static final int scanFormat (String pat, int index,				       StringBuffer buffer, Vector elts,				       Locale locale)  {    MessageFormatElement mfe = new MessageFormatElement ();    elts.addElement(mfe);    int max = pat.length();    // Skip the opening `{'.    ++index;    // Fetch the argument number.    index = scanFormatElement (pat, index, buffer, ',');    try      {	mfe.argNumber = Integer.parseInt(buffer.toString());      }    catch (NumberFormatException nfx)      {	throw new IllegalArgumentException("Failed to parse integer string");      }    // Extract the element format.    if (index < max && pat.charAt(index) == ',')      {	index = scanFormatElement (pat, index + 1, buffer, ',');	mfe.type = buffer.toString();	// Extract the style.	if (index < max && pat.charAt(index) == ',')	  {	    index = scanFormatElement (pat, index + 1, buffer, '}');	    mfe.style = buffer.toString ();	  }      }    // Advance past the last terminator.    if (index >= max || pat.charAt(index) != '}')      throw new IllegalArgumentException("Missing '}' at end of message format");    ++index;    // Now fetch trailing string.    index = scanString (pat, index, buffer);    mfe.trailer = buffer.toString ();    mfe.setLocale(locale);    return index;  }