2362N/A * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A ******************************************************************************* 1091N/A * (C) Copyright IBM Corp. and others, 1996-2009 - All Rights Reserved * 0N/A * The original version of this source code and documentation is copyrighted * 0N/A * and owned by IBM, These materials are provided under terms of a License * 0N/A * Agreement between IBM and Sun. This technology is protected by multiple * 0N/A * US and International patents. This notice and attribution to IBM may not * 0N/A ******************************************************************************* 1091N/A * Convenience utility to compare two Object[]s 1091N/A * @param len the length to compare. 1091N/A * The start indices and start+len must be valid. 0N/A * Convert characters outside the range U+0020 to U+007F to 0N/A * Unicode escapes, and convert backslash to a double backslash. 0N/A if (c >=
' ' && c <=
0x007F) {
0N/A /* This map must be in ASCENDING ORDER OF THE ESCAPE CODE */ 0N/A * Convert an escape to a 32-bit code point value. We attempt 0N/A * to parallel the icu4c unescapeAt() function. 0N/A * @param offset16 an array containing offset to the character 0N/A * <em>after</em> the backslash. Upon return offset16[0] will 0N/A * be updated to point after the escape sequence. 0N/A * @return character value from 0 to 10FFFF, or -1 on error. 0N/A /* Check that offset is in range */ 0N/A /* Fetch first UChar after '\\' */ 0N/A /* Convert hexadecimal and octal escapes */ 0N/A n =
1;
/* Already have first octal digit */ 0N/A if (c !=
0x7D /*}*/) {
0N/A // If an escape sequence specifies a lead surrogate, see 0N/A // if there is a trail surrogate after it, either as an 0N/A // escape or as a literal. If so, join them up into a 0N/A /* Convert C-style escapes in table */ 0N/A /* Map \cX to control-X: X & 0x1F */ 0N/A /* If no special forms are recognized, then consider 0N/A * the backslash to generically escape the next character. */ 0N/A * Convert a integer to size width hex uppercase digits. 0N/A * E.g., hex('a', 4, str) => "0041". 0N/A * Append the output to the given StringBuffer. 0N/A * If width is too small to fit, nothing will be appended to output. 0N/A * Convert a integer to size width (minimum) hex uppercase digits. 0N/A * E.g., hex('a', 4, str) => "0041". If the integer requires more 0N/A * than width digits, more will be used. 0N/A * Skip over a sequence of zero or more white space characters 0N/A * at pos. Return the index of the first non-white-space character 0N/A * at or after pos, or str.length(), if there is none. 0N/A '0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
0N/A 'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
0N/A 'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
0N/A 'U',
'V',
'W',
'X',
'Y',
'Z' 0N/A * Append the digits of a positive integer to the given 0N/A * <code>StringBuffer</code> in the given radix. This is 0N/A * done recursively since it is easiest to generate the low- 0N/A * order digit first, but it must be appended last. 0N/A * @param result is the <code>StringBuffer</code> to append to 0N/A * @param n is the positive integer 0N/A * @param radix is the radix, from 2 to 36 inclusive 0N/A * @param minDigits is the minimum number of digits to append. 0N/A * Append a number to the given StringBuffer in the given radix. 0N/A * Standard digits '0'-'9' are used and letters 'A'-'Z' for 0N/A * radices 11 through 36. 0N/A * @param result the digits of the number are appended here 0N/A * @param n the number to be converted to digits; may be negative. 0N/A * If negative, a '-' is prepended to the digits. 0N/A * @param radix a radix from 2 to 36 inclusive. 0N/A * @param minDigits the minimum number of digits, not including 0N/A * any '-', to produce. Values less than 2 have no effect. One 0N/A * digit is always emitted regardless of this parameter. 0N/A * @return a reference to result 0N/A * Return true if the character is NOT printable ASCII. The tab, 0N/A * newline and linefeed characters are considered unprintable. 0N/A return !(c >=
0x20 && c <=
0x7E);
0N/A * Escape unprintable characters using <backslash>uxxxx notation 0N/A * for U+0000 to U+FFFF and <backslash>Uxxxxxxxx for U+10000 and 0N/A * above. If the character is printable ASCII, then do nothing 0N/A * and return FALSE. Otherwise, append the escaped notation and 0N/A if ((c & ~
0xFFFF) !=
0) {
0N/A * Similar to StringBuffer.getChars, version 1.3. 0N/A * Since JDK 1.2 implements StringBuffer.getChars differently, this method 0N/A * is here to provide consistent results. 0N/A * To be removed after JDK 1.2 ceased to be the reference platform. 0N/A * @param src source string buffer 0N/A * @param srcBegin offset to the start of the src to retrieve from 0N/A * @param srcEnd offset to the end of the src to retrieve from 0N/A * @param dst char array to store the retrieved chars 0N/A * @param dstBegin offset to the start of the destination char array to 0N/A * store the retrieved chars