/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
*******************************************************************************
* Copyright (C) 2009, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
/**
* Collection of static utility methods for Locale support. The
* methods which manipulate characters or strings support ASCII only.
*/
public final class LocaleUtils {
private LocaleUtils() {
}
/**
* Compares two ASCII Strings s1 and s2, ignoring case.
*/
return true;
}
return false;
}
for (int i = 0; i < len; i++) {
return false;
}
}
return true;
}
return 0;
}
}
static char toUpper(char c) {
return isLower(c) ? (char)(c - 0x20) : c;
}
static char toLower(char c) {
return isUpper(c) ? (char)(c + 0x20) : c;
}
/**
* Converts the given ASCII String to lower-case.
*/
int idx = 0;
break;
}
}
return s;
}
for (int i = 0; i < len; i++) {
char c = s.charAt(i);
}
}
int idx = 0;
break;
}
}
return s;
}
for (int i = 0; i < len; i++) {
char c = s.charAt(i);
}
}
int len;
return s;
}
int idx = 0;
break;
}
}
}
return s;
}
for (int i = 0; i < len; i++) {
char c = s.charAt(i);
} else if (i < idx) {
buf[i] = c;
} else {
}
}
}
private static boolean isUpper(char c) {
return c >= 'A' && c <= 'Z';
}
private static boolean isLower(char c) {
return c >= 'a' && c <= 'z';
}
static boolean isAlpha(char c) {
return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
}
for (int i = 0; i < len; i++) {
return false;
}
}
return true;
}
static boolean isNumeric(char c) {
return (c >= '0' && c <= '9');
}
for (int i = 0; i < len; i++) {
return false;
}
}
return true;
}
static boolean isAlphaNumeric(char c) {
}
for (int i = 0; i < len; i++) {
if (!isAlphaNumeric(s.charAt(i))) {
return false;
}
}
return true;
}
}
}
}
}
}