repository.grepcode.com$java$root@jdk$openjdk@6-b14@sun$misc$ASCIICaseInsensitiveComparator.java
oh
o
[{"sl":36,"sc":-1,"el":97,"ec":-1,"m":"sun.misc.ASCIICaseInsensitiveComparator implements Comparator but not Serializable","p":3,"t":"SE_COMPARATOR_SHOULD_BE_SERIALIZABLE","a":"Se","c":"BAD_PRACTICE"}]
Implements a locale and case insensitive comparator suitable for
strings that are known to only contain ASCII characters. Some
tables internal to the JDK contain only ASCII data and are using
the "generalized" java.lang.String case-insensitive comparator
which converts each character to both upper and lower case.
int minLen = n1 < n2 ? n1 : n2;
for (int i=0; i < minLen; i++) { assert c1 <= '\u007F' && c2 <= '\u007F';
A case insensitive hash code method to go with the case insensitive
compare() method.
Returns a hash code for this ASCII string as if it were lower case.
returns same answer as:
s.toLowerCase(Locale.US).hashCode();
but does not allocate memory (it does NOT have the special
case Turkish rules).
- Parameters:
s a String to compute the hashcode on.- Returns:
- a hash code value for this object.
for (int i = 0; i < len; i++) { return ((ch-'a')|('z'-ch)) >= 0; return ((ch-'A')|('Z'-ch)) >= 0; return isUpper(ch) ? (ch + 0x20) : ch;
return isLower(ch) ? (ch - 0x20) : ch;