question: 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 ) ; }
target:  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.