Returns the lower case equivalent for the specified character if the character is an upper case letter. Otherwise, the specified character is returned unchanged. @param c the character @return if c is an upper case character then its lower case counterpart, otherwise just
(char c)
| 3545 | * counterpart, otherwise just {@code c}. |
| 3546 | */ |
| 3547 | public static char toLowerCase(char c) { |
| 3548 | // Optimized case for ASCII |
| 3549 | if ('A' <= c && c <= 'Z') { |
| 3550 | return (char) (c + ('a' - 'A')); |
| 3551 | } |
| 3552 | if (c < 192) {// || c == 215 || (c > 222 && c < 256)) { |
| 3553 | return c; |
| 3554 | } |
| 3555 | // if (c<1000) { |
| 3556 | // return (char)lowercaseValuesCache[c-192]; |
| 3557 | // } |
| 3558 | // |
| 3559 | // int result = BinarySearch.binarySearchRange(lowercaseKeys, c); |
| 3560 | // if (result >= 0) { |
| 3561 | // boolean by2 = false; |
| 3562 | // char start = lowercaseKeys.charAt(result); |
| 3563 | // char end = lowercaseValues[result * 2]; |
| 3564 | // if ((start & 0x8000) != (end & 0x8000)) { |
| 3565 | // end ^= 0x8000; |
| 3566 | // by2 = true; |
| 3567 | // } |
| 3568 | // if (c <= end) { |
| 3569 | // if (by2 && (c & 1) != (start & 1)) { |
| 3570 | // return c; |
| 3571 | // } |
| 3572 | // char mapping = lowercaseValues[result * 2 + 1]; |
| 3573 | // return (char) (c + mapping); |
| 3574 | // } |
| 3575 | // } |
| 3576 | return c; |
| 3577 | } |
| 3578 | |
| 3579 | /** |
| 3580 | * Returns the lower case equivalent for the specified code point if it is |
no outgoing calls
no test coverage detected