public StringBuffer format(Object pat,StringBuffer result,FieldPosition fpos){
  String pattern=processPattern((String)pat);
  int lastOffset=0;
  for (int i=0; i <= maxOffset; ++i) {
    int offidx=offsets[i];
    result.append(pattern.substring(lastOffset,offsets[i]));
    lastOffset=offidx;
    String key=arguments[i];
    String obj;
    if (key.length() > 0) {
      obj=formatObject(processKey(key));
    }
 else {
      result.append(this.ldel);
      result.append(this.rdel);
      continue;
    }
    if (obj == null) {
      String lessgreedy=ldel + key;
      int fromright=lessgreedy.lastIndexOf(ldel);
      if (fromright > 0) {
        String newkey=lessgreedy.substring(fromright + ldel.length());
        String newsubst=formatObject(processKey(newkey));
        if (newsubst != null) {
          obj=lessgreedy.substring(0,fromright) + newsubst;
        }
      }
    }
    if (obj == null) {
      if (throwex) {
        throw new IllegalArgumentException("ObjectForKey");
      }
 else {
        obj=ldel + key + rdel;
      }
    }
    result.append(obj);
  }
  result.append(pattern.substring(lastOffset,pattern.length()));
  return result;
}

public StringBuffer format ( Object pat , StringBuffer result , FieldPosition fpos ) { String pattern = processPattern ( ( String ) pat ) ; int lastOffset = 0 ; for ( int i = 0 ; i <= maxOffset ; ++ i ) { int offidx = offsets [ i ] ; result . append ( pattern . substring ( lastOffset , offsets [ i ] ) ) ; lastOffset = offidx ; String key = arguments [ i ] ; String obj ; if ( key . length ( ) > 0 ) { obj = formatObject ( processKey ( key ) ) ; } else { result . append ( this . ldel ) ; result . append ( this . rdel ) ; continue ; } if ( obj == null ) { String lessgreedy = ldel + key ; int fromright = lessgreedy . lastIndexOf ( ldel ) ; if ( fromright > 0 ) { String newkey = lessgreedy . substring ( fromright + ldel . length ( ) ) ; String newsubst = formatObject ( processKey ( newkey ) ) ; if ( newsubst != null ) { obj = lessgreedy . substring ( 0 , fromright ) + newsubst ; } } } if ( obj == null ) { if ( throwex ) { throw new IllegalArgumentException ( "ObjectForKey" ) ; } else { obj = ldel + key + rdel ; } } result . append ( obj ) ; } result . append ( pattern . substring ( lastOffset , pattern . length ( ) ) ) ; return result ; }
formats the parsed string by inserting table ' s values .
