private StringBuffer _toPattern(StringBuffer result,boolean escapeUnprintable){
  if (pat != null) {
    int i;
    int backslashCount=0;
    for (i=0; i < pat.length(); ) {
      int c=UTF16.charAt(pat,i);
      i+=UTF16.getCharCount(c);
      if (escapeUnprintable && Utility.isUnprintable(c)) {
        if ((backslashCount % 2) == 1) {
          result.setLength(result.length() - 1);
        }
        Utility.escapeUnprintable(result,c);
        backslashCount=0;
      }
 else {
        UTF16.append(result,c);
        if (c == '\\') {
          ++backslashCount;
        }
 else {
          backslashCount=0;
        }
      }
    }
    return result;
  }
  return _generatePattern(result,escapeUnprintable,true);
}

private StringBuffer _toPattern ( StringBuffer result , boolean escapeUnprintable ) { if ( pat != null ) { int i ; int backslashCount = 0 ; for ( i = 0 ; i < pat . length ( ) ; ) { int c = UTF16 . charAt ( pat , i ) ; i += UTF16 . getCharCount ( c ) ; if ( escapeUnprintable && Utility . isUnprintable ( c ) ) { if ( ( backslashCount % 2 ) == 1 ) { result . setLength ( result . length ( ) - 1 ) ; } Utility . escapeUnprintable ( result , c ) ; backslashCount = 0 ; } else { UTF16 . append ( result , c ) ; if ( c == '\\' ) { ++ backslashCount ; } else { backslashCount = 0 ; } } } return result ; } return _generatePattern ( result , escapeUnprintable , true ) ; }
append a string representation of this set to result . this will be a cleaned version of the string passed to applypattern ( ) , if there is one . otherwise it will be generated .
