FileDocCategorySizeDatePackage
Character.javaAPI DocAndroid 1.5 API114422Wed May 06 22:41:04 BST 2009java.lang

Character

public final class Character extends Object implements Serializable, Comparable
The wrapper for the primitive type {@code char}. This class also provides a number of utility methods for working with characters.

Character data is based upon the Unicode Standard, 4.0. The Unicode specification, character tables and other information are available at http://www.unicode.org/.

Unicode characters are referred to as code points. The range of valid code points is U+0000 to U+10FFFF. The Basic Multilingual Plane (BMP) is the code point range U+0000 to U+FFFF. Characters above the BMP are referred to as Supplementary Characters. On the Java platform, UTF-16 encoding and {@code char} pairs are used to represent code points in the supplementary range. A pair of {@code char} values that represent a supplementary character are made up of a high surrogate with a value range of 0xD800 to 0xDBFF and a low surrogate with a value range of 0xDC00 to 0xDFFF.

On the Java platform a {@code char} value represents either a single BMP code point or a UTF-16 unit that's part of a surrogate pair. The {@code int} type is used to represent all Unicode code points.

since
Android 1.0

Fields Summary
private static final long
serialVersionUID
private final char
value
public static final char
MIN_VALUE
The minimum {@code Character} value.
public static final char
MAX_VALUE
The maximum {@code Character} value.
public static final int
MIN_RADIX
The minimum radix used for conversions between characters and integers.
public static final int
MAX_RADIX
The maximum radix used for conversions between characters and integers.
public static final Class
TYPE
The {@link Class} object that represents the primitive type {@code char}.
public static final byte
UNASSIGNED
Unicode category constant Cn.
public static final byte
UPPERCASE_LETTER
Unicode category constant Lu.
public static final byte
LOWERCASE_LETTER
Unicode category constant Ll.
public static final byte
TITLECASE_LETTER
Unicode category constant Lt.
public static final byte
MODIFIER_LETTER
Unicode category constant Lm.
public static final byte
OTHER_LETTER
Unicode category constant Lo.
public static final byte
NON_SPACING_MARK
Unicode category constant Mn.
public static final byte
ENCLOSING_MARK
Unicode category constant Me.
public static final byte
COMBINING_SPACING_MARK
Unicode category constant Mc.
public static final byte
DECIMAL_DIGIT_NUMBER
Unicode category constant Nd.
public static final byte
LETTER_NUMBER
Unicode category constant Nl.
public static final byte
OTHER_NUMBER
Unicode category constant No.
public static final byte
SPACE_SEPARATOR
Unicode category constant Zs.
public static final byte
LINE_SEPARATOR
Unicode category constant Zl.
public static final byte
PARAGRAPH_SEPARATOR
Unicode category constant Zp.
public static final byte
CONTROL
Unicode category constant Cc.
public static final byte
FORMAT
Unicode category constant Cf.
public static final byte
PRIVATE_USE
Unicode category constant Co.
public static final byte
SURROGATE
Unicode category constant Cs.
public static final byte
DASH_PUNCTUATION
Unicode category constant Pd.
public static final byte
START_PUNCTUATION
Unicode category constant Ps.
public static final byte
END_PUNCTUATION
Unicode category constant Pe.
public static final byte
CONNECTOR_PUNCTUATION
Unicode category constant Pc.
public static final byte
OTHER_PUNCTUATION
Unicode category constant Po.
public static final byte
MATH_SYMBOL
Unicode category constant Sm.
public static final byte
CURRENCY_SYMBOL
Unicode category constant Sc.
public static final byte
MODIFIER_SYMBOL
Unicode category constant Sk.
public static final byte
OTHER_SYMBOL
Unicode category constant So.
public static final byte
INITIAL_QUOTE_PUNCTUATION
Unicode category constant Pi.
public static final byte
FINAL_QUOTE_PUNCTUATION
Unicode category constant Pf.
public static final byte
DIRECTIONALITY_UNDEFINED
Unicode bidirectional constant.
public static final byte
DIRECTIONALITY_LEFT_TO_RIGHT
Unicode bidirectional constant L.
public static final byte
DIRECTIONALITY_RIGHT_TO_LEFT
Unicode bidirectional constant R.
public static final byte
DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC
Unicode bidirectional constant AL.
public static final byte
DIRECTIONALITY_EUROPEAN_NUMBER
Unicode bidirectional constant EN.
public static final byte
DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR
Unicode bidirectional constant ES.
public static final byte
DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR
Unicode bidirectional constant ET.
public static final byte
DIRECTIONALITY_ARABIC_NUMBER
Unicode bidirectional constant AN.
public static final byte
DIRECTIONALITY_COMMON_NUMBER_SEPARATOR
Unicode bidirectional constant CS.
public static final byte
DIRECTIONALITY_NONSPACING_MARK
Unicode bidirectional constant NSM.
public static final byte
DIRECTIONALITY_BOUNDARY_NEUTRAL
Unicode bidirectional constant BN.
public static final byte
DIRECTIONALITY_PARAGRAPH_SEPARATOR
Unicode bidirectional constant B.
public static final byte
DIRECTIONALITY_SEGMENT_SEPARATOR
Unicode bidirectional constant S.
public static final byte
DIRECTIONALITY_WHITESPACE
Unicode bidirectional constant WS.
public static final byte
DIRECTIONALITY_OTHER_NEUTRALS
Unicode bidirectional constant ON.
public static final byte
DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING
Unicode bidirectional constant LRE.
public static final byte
DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE
Unicode bidirectional constant LRO.
public static final byte
DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING
Unicode bidirectional constant RLE.
public static final byte
DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE
Unicode bidirectional constant RLO.
public static final byte
DIRECTIONALITY_POP_DIRECTIONAL_FORMAT
Unicode bidirectional constant PDF.
public static final char
MIN_HIGH_SURROGATE
The minimum value of a high surrogate or leading surrogate unit in UTF-16 encoding, {@code '\uD800'}.
public static final char
MAX_HIGH_SURROGATE
The maximum value of a high surrogate or leading surrogate unit in UTF-16 encoding, {@code '\uDBFF'}.
public static final char
MIN_LOW_SURROGATE
The minimum value of a low surrogate or trailing surrogate unit in UTF-16 encoding, {@code '\uDC00'}.
public static final char
MAX_LOW_SURROGATE
The maximum value of a low surrogate or trailing surrogate unit in UTF-16 encoding, {@code '\uDFFF'}.
public static final char
MIN_SURROGATE
The minimum value of a surrogate unit in UTF-16 encoding, {@code '\uD800'}.
public static final char
MAX_SURROGATE
The maximum value of a surrogate unit in UTF-16 encoding, {@code '\uDFFF'}.
public static final int
MIN_SUPPLEMENTARY_CODE_POINT
The minimum value of a supplementary code point, {@code U+010000}.
public static final int
MIN_CODE_POINT
The minimum code point value, {@code U+0000}.
public static final int
MAX_CODE_POINT
The maximum code point value, {@code U+10FFFF}.
public static final int
SIZE
The number of bits required to represent a {@code Character} value in two's compliment form.
private static final char[]
typeTags
private static final byte[]
DIRECTIONALITY
private static final int
ISJAVASTART
private static final int
ISJAVAPART
private static final int
CACHE_LEN
Constructors Summary
public Character(char value)
Constructs a new {@code Character} with the specified primitive char value.

param
value the primitive char value to store in the new instance.
since
Android 1.0

        this.value = value;
    
Methods Summary
public static intcharCount(int codePoint)
Calculates the number of {@code char} values required to represent the specified Unicode code point. This method checks if the {@code codePoint} is greater than or equal to {@code 0x10000}, in which case {@code 2} is returned, otherwise {@code 1}. To test if the code point is valid, use the {@link #isValidCodePoint(int)} method.

param
codePoint the code point for which to calculate the number of required chars.
return
{@code 2} if {@code codePoint >= 0x10000}; {@code 1} otherwise.
since
Android 1.0

        return (codePoint >= 0x10000 ? 2 : 1);
    
public charcharValue()
Gets the primitive value of this character.

return
this object's primitive value.
since
Android 1.0

        return value;
    
public static intcodePointAt(java.lang.CharSequence seq, int index)
Returns the code point at {@code index} in the specified sequence of character units. If the unit at {@code index} is a high-surrogate unit, {@code index + 1} is less than the length of the sequence and the unit at {@code index + 1} is a low-surrogate unit, then the supplementary code point represented by the pair is returned; otherwise the {@code char} value at {@code index} is returned.

param
seq the source sequence of {@code char} units.
param
index the position in {@code seq} from which to retrieve the code point.
return
the Unicode code point or {@code char} value at {@code index} in {@code seq}.
throws
IndexOutOfBoundsException if the {@code index} is negative or greater than or equal to the length of {@code seq}.
since
Android 1.0

        if (seq == null) {
            throw new NullPointerException();
        }
        int len = seq.length();
        if (index < 0 || index >= len) {
            throw new IndexOutOfBoundsException();
        }

        char high = seq.charAt(index++);
        if (index >= len) {
            return high;
        }
        char low = seq.charAt(index);
        if (isSurrogatePair(high, low)) {
            return toCodePoint(high, low);
        }
        return high;
    
public static intcodePointAt(char[] seq, int index)
Returns the code point at {@code index} in the specified array of character units. If the unit at {@code index} is a high-surrogate unit, {@code index + 1} is less than the length of the array and the unit at {@code index + 1} is a low-surrogate unit, then the supplementary code point represented by the pair is returned; otherwise the {@code char} value at {@code index} is returned.

param
seq the source array of {@code char} units.
param
index the position in {@code seq} from which to retrieve the code point.
return
the Unicode code point or {@code char} value at {@code index} in {@code seq}.
throws
IndexOutOfBoundsException if the {@code index} is negative or greater than or equal to the length of {@code seq}.
since
Android 1.0

        if (seq == null) {
            throw new NullPointerException();
        }
        int len = seq.length;
        if (index < 0 || index >= len) {
            throw new IndexOutOfBoundsException();
        }

        char high = seq[index++];
        if (index >= len) {
            return high;
        }
        char low = seq[index];
        if (isSurrogatePair(high, low)) {
            return toCodePoint(high, low);
        }
        return high;
    
public static intcodePointAt(char[] seq, int index, int limit)
Returns the code point at {@code index} in the specified array of character units, where {@code index} has to be less than {@code limit}. If the unit at {@code index} is a high-surrogate unit, {@code index + 1} is less than {@code limit} and the unit at {@code index + 1} is a low-surrogate unit, then the supplementary code point represented by the pair is returned; otherwise the {@code char} value at {@code index} is returned.

param
seq the source array of {@code char} units.
param
index the position in {@code seq} from which to get the code point.
param
limit the index after the last unit in {@code seq} that can be used.
return
the Unicode code point or {@code char} value at {@code index} in {@code seq}.
throws
IndexOutOfBoundsException if {@code index < 0}, {@code index >= limit}, {@code limit < 0} or if {@code limit} is greater than the length of {@code seq}.
since
Android 1.0

        if (index < 0 || index >= limit || limit < 0 || limit > seq.length) {
            throw new IndexOutOfBoundsException();
        }       

        char high = seq[index++];
        if (index >= limit) {
            return high;
        }
        char low = seq[index];
        if (isSurrogatePair(high, low)) {
            return toCodePoint(high, low);
        }
        return high;
    
public static intcodePointBefore(java.lang.CharSequence seq, int index)
Returns the code point that preceds {@code index} in the specified sequence of character units. If the unit at {@code index - 1} is a low-surrogate unit, {@code index - 2} is not negative and the unit at {@code index - 2} is a high-surrogate unit, then the supplementary code point represented by the pair is returned; otherwise the {@code char} value at {@code index - 1} is returned.

param
seq the source sequence of {@code char} units.
param
index the position in {@code seq} following the code point that should be returned.
return
the Unicode code point or {@code char} value before {@code index} in {@code seq}.
throws
IndexOutOfBoundsException if the {@code index} is less than 1 or greater than the length of {@code seq}.
since
Android 1.0

        if (seq == null) {
            throw new NullPointerException();
        }
        int len = seq.length();
        if (index < 1 || index > len) {
            throw new IndexOutOfBoundsException();
        }

        char low = seq.charAt(--index);
        if (--index < 0) {
            return low;
        }
        char high = seq.charAt(index);
        if (isSurrogatePair(high, low)) {
            return toCodePoint(high, low);
        }
        return low;
    
public static intcodePointBefore(char[] seq, int index)
Returns the code point that preceds {@code index} in the specified array of character units. If the unit at {@code index - 1} is a low-surrogate unit, {@code index - 2} is not negative and the unit at {@code index - 2} is a high-surrogate unit, then the supplementary code point represented by the pair is returned; otherwise the {@code char} value at {@code index - 1} is returned.

param
seq the source array of {@code char} units.
param
index the position in {@code seq} following the code point that should be returned.
return
the Unicode code point or {@code char} value before {@code index} in {@code seq}.
throws
IndexOutOfBoundsException if the {@code index} is less than 1 or greater than the length of {@code seq}.
since
Android 1.0

        if (seq == null) {
            throw new NullPointerException();
        }
        int len = seq.length;
        if (index < 1 || index > len) {
            throw new IndexOutOfBoundsException();
        }

        char low = seq[--index];
        if (--index < 0) {
            return low;
        }
        char high = seq[index];
        if (isSurrogatePair(high, low)) {
            return toCodePoint(high, low);
        }
        return low;
    
public static intcodePointBefore(char[] seq, int index, int start)
Returns the code point that preceds the {@code index} in the specified array of character units and is not less than {@code start}. If the unit at {@code index - 1} is a low-surrogate unit, {@code index - 2} is not less than {@code start} and the unit at {@code index - 2} is a high-surrogate unit, then the supplementary code point represented by the pair is returned; otherwise the {@code char} value at {@code index - 1} is returned.

param
seq the source array of {@code char} units.
param
index the position in {@code seq} following the code point that should be returned.
param
start the index of the first element in {@code seq}.
return
the Unicode code point or {@code char} value before {@code index} in {@code seq}.
throws
IndexOutOfBoundsException if the {@code index <= start}, {@code start < 0}, {@code index} is greater than the length of {@code seq}, or if {@code start} is equal or greater than the length of {@code seq}.
since
Android 1.0

        if (seq == null) {
            throw new NullPointerException();
        }
        int len = seq.length;
        if (index <= start || index > len || start < 0 || start >= len) {
            throw new IndexOutOfBoundsException();
        }

        char low = seq[--index];
        if (--index < start) {
            return low;
        }
        char high = seq[index];
        if (isSurrogatePair(high, low)) {
            return toCodePoint(high, low);
        }
        return low;
    
public static intcodePointCount(java.lang.CharSequence seq, int beginIndex, int endIndex)
Counts the number of Unicode code points in the subsequence of the specified character sequence, as delineated by {@code beginIndex} and {@code endIndex}. Any surrogate values with missing pair values will be counted as one code point.

param
seq the {@code CharSequence} to look through.
param
beginIndex the inclusive index to begin counting at.
param
endIndex the exclusive index to stop counting at.
return
the number of Unicode code points.
throws
IndexOutOfBoundsException if {@code beginIndex < 0}, {@code beginIndex > endIndex} or if {@code endIndex} is greater than the length of {@code seq}.
since
Android 1.0

        if (seq == null) {
            throw new NullPointerException();
        }
        int len = seq.length();
        if (beginIndex < 0 || endIndex > len || beginIndex > endIndex) {
            throw new IndexOutOfBoundsException();
        }

        int result = 0;
        for (int i = beginIndex; i < endIndex; i++) {
            char c = seq.charAt(i);
            if (isHighSurrogate(c)) {
                if (++i < endIndex) {
                    c = seq.charAt(i);
                    if (!isLowSurrogate(c)) {
                        result++;
                    }
                }
            }
            result++;
        }
        return result;
    
public static intcodePointCount(char[] seq, int offset, int count)
Counts the number of Unicode code points in the subsequence of the specified char array, as delineated by {@code offset} and {@code count}. Any surrogate values with missing pair values will be counted as one code point.

param
seq the char array to look through
param
offset the inclusive index to begin counting at.
param
count the number of {@code char} values to look through in {@code seq}.
return
the number of Unicode code points.
throws
IndexOutOfBoundsException if {@code offset < 0}, {@code count < 0} or if {@code offset + count} is greater than the length of {@code seq}.
since
Android 1.0

        if (seq == null) {
            throw new NullPointerException();
        }
        int len = seq.length;
        int endIndex = offset + count;
        if (offset < 0 || count < 0 || endIndex > len) {
            throw new IndexOutOfBoundsException();
        }

        int result = 0;
        for (int i = offset; i < endIndex; i++) {
            char c = seq[i];
            if (isHighSurrogate(c)) {
                if (++i < endIndex) {
                    c = seq[i];
                    if (!isLowSurrogate(c)) {
                        result++;
                    }
                }
            }
            result++;
        }
        return result;
    
public intcompareTo(java.lang.Character c)
Compares this object to the specified character object to determine their relative order.

param
c the character object to compare this object to.
return
{@code 0} if the value of this character and the value of {@code c} are equal; a positive value if the value of this character is greater than the value of {@code c}; a negative value if the value of this character is less than the value of {@code c}.
see
java.lang.Comparable
since
Android 1.0

        return value - c.value;
    
public static intdigit(char c, int radix)
Convenience method to determine the value of the specified character {@code c} in the supplied radix. The value of {@code radix} must be between MIN_RADIX and MAX_RADIX.

param
c the character to determine the value of.
param
radix the radix.
return
the value of {@code c} in {@code radix} if {@code radix} lies between {@link #MIN_RADIX} and {@link #MAX_RADIX}; -1 otherwise.
since
Android 1.0

        // BEGIN android-changed
        // if (radix >= MIN_RADIX && radix <= MAX_RADIX) {
        //     if (c < 128) {
        //         // Optimized for ASCII
        //         int result = -1;
        //         if ('0' <= c && c <= '9') {
        //             result = c - '0';
        //         } else if ('a' <= c && c <= 'z') {
        //             result = c - ('a' - 10);
        //         } else if ('A' <= c && c <= 'Z') {
        //             result = c - ('A' - 10);
        //         }
        //         return result < radix ? result : -1;
        //     }
        //     int result = BinarySearch.binarySearchRange(digitKeys, c);
        //     if (result >= 0 && c <= digitValues[result * 2]) {
        //         int value = (char) (c - digitValues[result * 2 + 1]);
        //         if (value >= radix) {
        //             return -1;
        //         }
        //         return value;
        //     }
        // }
        // return -1;
        return UCharacter.digit(c, radix);
        // ENd android-changed
    
public static intdigit(int codePoint, int radix)
Convenience method to determine the value of the character {@code codePoint} in the supplied radix. The value of {@code radix} must be between MIN_RADIX and MAX_RADIX.

param
codePoint the character, including supplementary characters.
param
radix the radix.
return
if {@code radix} lies between {@link #MIN_RADIX} and {@link #MAX_RADIX} then the value of the character in the radix; -1 otherwise.
since
Android 1.0

        return UCharacter.digit(codePoint, radix);
    
public booleanequals(java.lang.Object object)
Compares this object with the specified object and indicates if they are equal. In order to be equal, {@code object} must be an instance of {@code Character} and have the same char value as this object.

param
object the object to compare this double with.
return
{@code true} if the specified object is equal to this {@code Character}; {@code false} otherwise.
since
Android 1.0

        return (object instanceof Character)
                && (value == ((Character) object).value);
    
public static charforDigit(int digit, int radix)
Returns the character which represents the specified digit in the specified radix. The {@code radix} must be between {@code MIN_RADIX} and {@code MAX_RADIX} inclusive; {@code digit} must not be negative and smaller than {@code radix}. If any of these conditions does not hold, 0 is returned.

param
digit the integer value.
param
radix the radix.
return
the character which represents the {@code digit} in the {@code radix}.
since
Android 1.0

        if (MIN_RADIX <= radix && radix <= MAX_RADIX) {
            if (0 <= digit && digit < radix) {
                return (char) (digit < 10 ? digit + '0" : digit + 'a" - 10);
            }
        }
        return 0;
    
public static bytegetDirectionality(char c)
Gets the Unicode directionality of the specified character.

param
c the character to get the directionality of.
return
the Unicode directionality of {@code c}.
since
Android 1.0

        // BEGIN android-changed
        // int result = BinarySearch.binarySearchRange(bidiKeys, c);
        // int high = bidiValues[result * 2];
        // if (c <= high) {
        //     int code = bidiValues[result * 2 + 1];
        //     if (code < 0x100) {
        //         return (byte) (code - 1);
        //     }
        //     return (byte) (((c & 1) == 1 ? code >> 8 : code & 0xff) - 1);
        // }
        // return DIRECTIONALITY_UNDEFINED;
        return getDirectionality((int)c);
        // END android-changed
    
public static bytegetDirectionality(int codePoint)
Gets the Unicode directionality of the specified character.

param
codePoint the Unicode code point to get the directionality of.
return
the Unicode directionality of {@code codePoint}.
since
Android 1.0

        if (getType(codePoint) == Character.UNASSIGNED) {
            return Character.DIRECTIONALITY_UNDEFINED;
        }
        
        byte UCDirectionality = UCharacter.getDirectionality(codePoint);       
        if (UCDirectionality == -1) {
            return -1;
        }
        return DIRECTIONALITY[UCDirectionality];
    
public static intgetNumericValue(char c)
Gets the numeric value of the specified Unicode character.

param
c the Unicode character to get the numeric value of.
return
a non-negative numeric integer value if a numeric value for {@code c} exists, -1 if there is no numeric value for {@code c}, -2 if the numeric value can not be represented with an integer.
since
Android 1.0

        // BEGIN android-changed
        // if (c < 128) {
        //     // Optimized for ASCII
        //     if (c >= '0' && c <= '9') {
        //         return c - '0';
        //     }
        //     if (c >= 'a' && c <= 'z') {
        //         return c - ('a' - 10);
        //     }
        //     if (c >= 'A' && c <= 'Z') {
        //         return c - ('A' - 10);
        //     }
        //     return -1;
        // }
        // int result = BinarySearch.binarySearchRange(numericKeys, c);
        // if (result >= 0 && c <= numericValues[result * 2]) {
        //     char difference = numericValues[result * 2 + 1];
        //     if (difference == 0) {
        //         return -2;
        //     }
        //     // Value is always positive, must be negative value
        //     if (difference > c) {
        //         return c - (short) difference;
        //     }
        //     return c - difference;
        // }
        // return -1;
        return UCharacter.getNumericValue(c);
        // END android-changed
    
public static intgetNumericValue(int codePoint)
Gets the numeric value of the specified Unicode code point. For example, the code point '\u216B' stands for the Roman number XII, which has the numeric value 12.

param
codePoint the Unicode code point to get the numeric value of.
return
a non-negative numeric integer value if a numeric value for {@code codePoint} exists, -1 if there is no numeric value for {@code codePoint}, -2 if the numeric value can not be represented with an integer.
since
Android 1.0

        return UCharacter.getNumericValue(codePoint);
    
public static intgetType(char c)
Gets the general Unicode category of the specified character.

param
c the character to get the category of.
return
the Unicode category of {@code c}.
since
Android 1.0

        // BEGIN android-changed
        // int result = BinarySearch.binarySearchRange(typeKeys, c);
        // int high = typeValues[result * 2];
        // if (c <= high) {
        //     int code = typeValues[result * 2 + 1];
        //     if (code < 0x100) {
        //         return code;
        //     }
        //     return (c & 1) == 1 ? code >> 8 : code & 0xff;
        // }
        // return UNASSIGNED;
        return getType((int)c);
        // END android-changed
    
public static intgetType(int codePoint)
Gets the general Unicode category of the specified code point.

param
codePoint the Unicode code point to get the category of.
return
the Unicode category of {@code codePoint}.
since
Android 1.0

        int type = UCharacter.getType(codePoint);

        // the type values returned by UCharacter are not compatible with what
        // the spec says.RI's Character type values skip the value 17.
        if (type <= Character.FORMAT) {
            return type;
        }
        return (type + 1);
    
public inthashCode()

        return value;
    
public static booleanisDefined(char c)
Indicates whether the specified character is defined in the Unicode specification.

param
c the character to check.
return
{@code true} if the general Unicode category of the character is not {@code UNASSIGNED}; {@code false} otherwise.
since
Android 1.0

        // BEGIN android-changed
        // return getType(c) != UNASSIGNED;
        return UCharacter.isDefined(c);
        // END android-changed
    
public static booleanisDefined(int codePoint)
Indicates whether the specified code point is defined in the Unicode specification.

param
codePoint the code point to check.
return
{@code true} if the general Unicode category of the code point is not {@code UNASSIGNED}; {@code false} otherwise.
since
Android 1.0

        return UCharacter.isDefined(codePoint);
    
public static booleanisDigit(char c)
Indicates whether the specified character is a digit.

param
c the character to check.
return
{@code true} if {@code c} is a digit; {@code false} otherwise.
since
Android 1.0

        // BEGIN android-changed
        // // Optimized case for ASCII
        // if ('0' <= c && c <= '9') {
        //     return true;
        // }
        // if (c < 1632) {
        //     return false;
        // }
        // return getType(c) == DECIMAL_DIGIT_NUMBER;
        return UCharacter.isDigit(c);
        // END android-changed
    
public static booleanisDigit(int codePoint)
Indicates whether the specified code point is a digit.

param
codePoint the code point to check.
return
{@code true} if {@code codePoint} is a digit; {@code false} otherwise.
since
Android 1.0

        return UCharacter.isDigit(codePoint);
    
public static booleanisHighSurrogate(char ch)
Indicates whether {@code ch} is a high- (or leading-) surrogate code unit that is used for representing supplementary characters in UTF-16 encoding.

param
ch the character to test.
return
{@code true} if {@code ch} is a high-surrogate code unit; {@code false} otherwise.
see
#isLowSurrogate(char)
since
Android 1.0

        return (MIN_HIGH_SURROGATE <= ch && MAX_HIGH_SURROGATE >= ch);
    
public static booleanisISOControl(char c)
Indicates whether the specified character is an ISO control character.

param
c the character to check.
return
{@code true} if {@code c} is an ISO control character; {@code false} otherwise.
since
Android 1.0

        return isISOControl((int)c);
    
public static booleanisISOControl(int c)
Indicates whether the specified code point is an ISO control character.

param
c the code point to check.
return
{@code true} if {@code c} is an ISO control character; {@code false} otherwise.
since
Android 1.0

        return (c >= 0 && c <= 0x1f) || (c >= 0x7f && c <= 0x9f);
    
public static booleanisIdentifierIgnorable(char c)
Indicates whether the specified character is ignorable in a Java or Unicode identifier.

param
c the character to check.
return
{@code true} if {@code c} is ignorable; {@code false} otherwise.
since
Android 1.0

        // BEGIN android-changed
        // return (c >= 0 && c <= 8) || (c >= 0xe && c <= 0x1b)
        //         || (c >= 0x7f && c <= 0x9f) || getType(c) == FORMAT;
        return UCharacter.isIdentifierIgnorable(c);
        // END android-changed
    
public static booleanisIdentifierIgnorable(int codePoint)
Indicates whether the specified code point is ignorable in a Java or Unicode identifier.

param
codePoint the code point to check.
return
{@code true} if {@code codePoint} is ignorable; {@code false} otherwise.
since
Android 1.0

        return UCharacter.isIdentifierIgnorable(codePoint);
    
public static booleanisJavaIdentifierPart(char c)
Indicates whether the specified character is a valid part of a Java identifier other than the first character.

param
c the character to check.
return
{@code true} if {@code c} is valid as part of a Java identifier; {@code false} otherwise.
since
Android 1.0

        // Optimized case for ASCII
        if (c < 128) {
            return (typeTags[c] & ISJAVAPART) != 0;
        }

        int type = getType(c);
        return (type >= UPPERCASE_LETTER && type <= OTHER_LETTER)
                || type == CURRENCY_SYMBOL || type == CONNECTOR_PUNCTUATION
                || (type >= DECIMAL_DIGIT_NUMBER && type <= LETTER_NUMBER)
                || type == NON_SPACING_MARK || type == COMBINING_SPACING_MARK
                || (c >= 0x80 && c <= 0x9f) || type == FORMAT;
    
public static booleanisJavaIdentifierPart(int codePoint)
Indicates whether the specified code point is a valid part of a Java identifier other than the first character.

param
codePoint the code point to check.
return
{@code true} if {@code c} is valid as part of a Java identifier; {@code false} otherwise.
since
Android 1.0

        int type = getType(codePoint);
        return (type >= UPPERCASE_LETTER && type <= OTHER_LETTER)
                || type == CURRENCY_SYMBOL || type == CONNECTOR_PUNCTUATION
                || (type >= DECIMAL_DIGIT_NUMBER && type <= LETTER_NUMBER)
                || type == COMBINING_SPACING_MARK || type == NON_SPACING_MARK 
                || isIdentifierIgnorable(codePoint);
    
public static booleanisJavaIdentifierStart(char c)
Indicates whether the specified character is a valid first character for a Java identifier.

param
c the character to check.
return
{@code true} if {@code c} is a valid first character of a Java identifier; {@code false} otherwise.
since
Android 1.0

        // Optimized case for ASCII
        if (c < 128) {
            return (typeTags[c] & ISJAVASTART) != 0;
        }

        int type = getType(c);
        return (type >= UPPERCASE_LETTER && type <= OTHER_LETTER)
                || type == CURRENCY_SYMBOL || type == CONNECTOR_PUNCTUATION
                || type == LETTER_NUMBER;
    
public static booleanisJavaIdentifierStart(int codePoint)
Indicates whether the specified code point is a valid start for a Java identifier.

param
codePoint the code point to check.
return
{@code true} if {@code codePoint} is a valid start of a Java identifier; {@code false} otherwise.
since
Android 1.0

        int type = getType(codePoint);
        return isLetter(codePoint) || type == CURRENCY_SYMBOL
                || type == CONNECTOR_PUNCTUATION || type == LETTER_NUMBER;
    
public static booleanisJavaLetter(char c)
Indicates whether the specified character is a Java letter.

param
c the character to check.
return
{@code true} if {@code c} is a Java letter; {@code false} otherwise.
deprecated
Use {@link #isJavaIdentifierStart(char)}
since
Android 1.0

        return isJavaIdentifierStart(c);
    
public static booleanisJavaLetterOrDigit(char c)
Indicates whether the specified character is a Java letter or digit character.

param
c the character to check.
return
{@code true} if {@code c} is a Java letter or digit; {@code false} otherwise.
deprecated
Use {@link #isJavaIdentifierPart(char)}
since
Android 1.0

        return isJavaIdentifierPart(c);
    
public static booleanisLetter(char c)
Indicates whether the specified character is a letter.

param
c the character to check.
return
{@code true} if {@code c} is a letter; {@code false} otherwise.
since
Android 1.0

        // BEGIN android-changed
        // if (('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z')) {
        //     return true;
        // }
        // if (c < 128) {
        //     return false;
        // }
        // int type = getType(c);
        // return type >= UPPERCASE_LETTER && type <= OTHER_LETTER;
        return UCharacter.isLetter(c);
        // END android-changed
    
public static booleanisLetter(int codePoint)
Indicates whether the specified code point is a letter.

param
codePoint the code point to check.
return
{@code true} if {@code codePoint} is a letter; {@code false} otherwise.
since
Android 1.0

        return UCharacter.isLetter(codePoint);
    
public static booleanisLetterOrDigit(char c)
Indicates whether the specified character is a letter or a digit.

param
c the character to check.
return
{@code true} if {@code c} is a letter or a digit; {@code false} otherwise.
since
Android 1.0

        // BEGIN android-changed
        // int type = getType(c);
        // return (type >= UPPERCASE_LETTER && type <= OTHER_LETTER)
        //         || type == DECIMAL_DIGIT_NUMBER;
        return UCharacter.isLetterOrDigit(c);
        // END andorid-changed
    
public static booleanisLetterOrDigit(int codePoint)
Indicates whether the specified code point is a letter or a digit.

param
codePoint the code point to check.
return
{@code true} if {@code codePoint} is a letter or a digit; {@code false} otherwise.
since
Android 1.0

        return UCharacter.isLetterOrDigit(codePoint);
    
public static booleanisLowSurrogate(char ch)
Indicates whether {@code ch} is a low- (or trailing-) surrogate code unit that is used for representing supplementary characters in UTF-16 encoding.

param
ch the character to test.
return
{@code true} if {@code ch} is a low-surrogate code unit; {@code false} otherwise.
see
#isHighSurrogate(char)
since
Android 1.0

        return (MIN_LOW_SURROGATE <= ch && MAX_LOW_SURROGATE >= ch);
    
public static booleanisLowerCase(char c)
Indicates whether the specified character is a lower case letter.

param
c the character to check.
return
{@code true} if {@code c} is a lower case letter; {@code false} otherwise.
since
Android 1.0

        // BEGIN android-changed
        // // Optimized case for ASCII
        // if ('a' <= c && c <= 'z') {
        //     return true;
        // }
        // if (c < 128) {
        //     return false;
        // }
        // 
        // return getType(c) == LOWERCASE_LETTER;
        return UCharacter.isLowerCase(c);
        // END android-changed
    
public static booleanisLowerCase(int codePoint)
Indicates whether the specified code point is a lower case letter.

param
codePoint the code point to check.
return
{@code true} if {@code codePoint} is a lower case letter; {@code false} otherwise.
since
Android 1.0

        return UCharacter.isLowerCase(codePoint);
    
public static booleanisMirrored(char c)
Indicates whether the specified character is mirrored.

param
c the character to check.
return
{@code true} if {@code c} is mirrored; {@code false} otherwise.
since
Android 1.0

        // BEGIN android-changed
        // int value = c / 16;
        // if (value >= mirrored.length) {
        //     return false;
        // }
        // int bit = 1 << (c % 16);
        // return (mirrored[value] & bit) != 0;
        return isMirrored((int)c);
        // ENd android-changed
    
public static booleanisMirrored(int codePoint)
Indicates whether the specified code point is mirrored.

param
codePoint the code point to check.
return
{@code true} if {@code codePoint} is mirrored, {@code false} otherwise.
since
Android 1.0

        return UCharacter.isMirrored(codePoint);
    
public static booleanisSpace(char c)
Indicates whether the specified character is a Java space.

param
c the character to check.
return
{@code true} if {@code c} is a Java space; {@code false} otherwise.
deprecated
Use {@link #isWhitespace(char)}
since
Android 1.0

        return c == '\n" || c == '\t" || c == '\f" || c == '\r" || c == ' ";
    
public static booleanisSpaceChar(char c)
Indicates whether the specified character is a Unicode space character. That is, if it is a member of one of the Unicode categories Space Separator, Line Separator, or Paragraph Separator.

param
c the character to check.
return
{@code true} if {@code c} is a Unicode space character, {@code false} otherwise.
since
Android 1.0

        // BEGIN android-changed
        // if (c == 0x20 || c == 0xa0 || c == 0x1680) {
        //     return true;
        // }
        // if (c < 0x2000) {
        //     return false;
        // }
        // return c <= 0x200b || c == 0x2028 || c == 0x2029 || c == 0x202f
        //         || c == 0x3000;
        return UCharacter.isSpaceChar(c);
        // END android-changed
    
public static booleanisSpaceChar(int codePoint)
Indicates whether the specified code point is a Unicode space character. That is, if it is a member of one of the Unicode categories Space Separator, Line Separator, or Paragraph Separator.

param
codePoint the code point to check.
return
{@code true} if {@code codePoint} is a Unicode space character, {@code false} otherwise.
since
Android 1.0

        return UCharacter.isSpaceChar(codePoint);
    
public static booleanisSupplementaryCodePoint(int codePoint)
Indicates whether {@code codePoint} is within the supplementary code point range.

param
codePoint the code point to test.
return
{@code true} if {@code codePoint} is within the supplementary code point range; {@code false} otherwise.
since
Android 1.0

        return (MIN_SUPPLEMENTARY_CODE_POINT <= codePoint && MAX_CODE_POINT >= codePoint);
    
public static booleanisSurrogatePair(char high, char low)
Indicates whether the specified character pair is a valid surrogate pair.

param
high the high surrogate unit to test.
param
low the low surrogate unit to test.
return
{@code true} if {@code high} is a high-surrogate code unit and {@code low} is a low-surrogate code unit; {@code false} otherwise.
see
#isHighSurrogate(char)
see
#isLowSurrogate(char)
since
Android 1.0

        return (isHighSurrogate(high) && isLowSurrogate(low));
    
public static booleanisTitleCase(char c)
Indicates whether the specified character is a titlecase character.

param
c the character to check.
return
{@code true} if {@code c} is a titlecase character, {@code false} otherwise.
since
Android 1.0

        // BEGIN android-changed
        // if (c == '\u01c5' || c == '\u01c8' || c == '\u01cb' || c == '\u01f2') {
        //     return true;
        // }
        // if (c >= '\u1f88' && c <= '\u1ffc') {
        //     // 0x1f88 - 0x1f8f, 0x1f98 - 0x1f9f, 0x1fa8 - 0x1faf
        //     if (c > '\u1faf') {
        //         return c == '\u1fbc' || c == '\u1fcc' || c == '\u1ffc';
        //     }
        //     int last = c & 0xf;
        //     return last >= 8 && last <= 0xf;
        // }
        // return false;
        return UCharacter.isTitleCase(c);
        // END android-changed
    
public static booleanisTitleCase(int codePoint)
Indicates whether the specified code point is a titlecase character.

param
codePoint the code point to check.
return
{@code true} if {@code codePoint} is a titlecase character, {@code false} otherwise.
since
Android 1.0

        return UCharacter.isTitleCase(codePoint);
    
public static booleanisUnicodeIdentifierPart(char c)
Indicates whether the specified character is valid as part of a Unicode identifier other than the first character.

param
c the character to check.
return
{@code true} if {@code c} is valid as part of a Unicode identifier; {@code false} otherwise.
since
Android 1.0

        // BEGIN android-changed
        // int type = getType(c);
        // return (type >= UPPERCASE_LETTER && type <= OTHER_LETTER)
        //         || type == CONNECTOR_PUNCTUATION
        //         || (type >= DECIMAL_DIGIT_NUMBER && type <= LETTER_NUMBER)
        //         || type == NON_SPACING_MARK || type == COMBINING_SPACING_MARK
        //         || isIdentifierIgnorable(c);
        return UCharacter.isUnicodeIdentifierPart(c);
        // END android-changed
    
public static booleanisUnicodeIdentifierPart(int codePoint)
Indicates whether the specified code point is valid as part of a Unicode identifier other than the first character.

param
codePoint the code point to check.
return
{@code true} if {@code codePoint} is valid as part of a Unicode identifier; {@code false} otherwise.
since
Android 1.0

        return UCharacter.isUnicodeIdentifierPart(codePoint);
    
public static booleanisUnicodeIdentifierStart(char c)
Indicates whether the specified character is a valid initial character for a Unicode identifier.

param
c the character to check.
return
{@code true} if {@code c} is a valid first character for a Unicode identifier; {@code false} otherwise.
since
Android 1.0

        // BEGIN android-changed
        // int type = getType(c);
        // return (type >= UPPERCASE_LETTER && type <= OTHER_LETTER)
        //         || type == LETTER_NUMBER;
        return UCharacter.isUnicodeIdentifierStart(c);
        // END android-changed
    
public static booleanisUnicodeIdentifierStart(int codePoint)
Indicates whether the specified code point is a valid initial character for a Unicode identifier.

param
codePoint the code point to check.
return
{@code true} if {@code codePoint} is a valid first character for a Unicode identifier; {@code false} otherwise.
since
Android 1.0

        return UCharacter.isUnicodeIdentifierStart(codePoint);
    
public static booleanisUpperCase(char c)
Indicates whether the specified character is an upper case letter.

param
c the character to check.
return
{@code true} if {@code c} is a upper case letter; {@code false} otherwise.
since
Android 1.0

        // BEGIN android-changed
        // // Optimized case for ASCII
        // if ('A' <= c && c <= 'Z') {
        //     return true;
        // }
        // if (c < 128) {
        //     return false;
        // }
        // 
        // return getType(c) == UPPERCASE_LETTER;
        return UCharacter.isUpperCase(c);
        // END android-changed
    
public static booleanisUpperCase(int codePoint)
Indicates whether the specified code point is an upper case letter.

param
codePoint the code point to check.
return
{@code true} if {@code codePoint} is a upper case letter; {@code false} otherwise.
since
Android 1.0

        return UCharacter.isUpperCase(codePoint);
    
public static booleanisValidCodePoint(int codePoint)
Indicates whether {@code codePoint} is a valid Unicode code point.

param
codePoint the code point to test.
return
{@code true} if {@code codePoint} is a valid Unicode code point; {@code false} otherwise.
since
Android 1.0


         
            for(int i=0; i<CACHE.length; i++){
                CACHE[i] =  new Character((char)i);
            }
        
        return (MIN_CODE_POINT <= codePoint && MAX_CODE_POINT >= codePoint);
    
public static booleanisWhitespace(char c)
Indicates whether the specified character is a whitespace character in Java.

param
c the character to check.
return
{@code true} if the supplied {@code c} is a whitespace character in Java; {@code false} otherwise.
since
Android 1.0

        // BEGIN android-changed
        // // Optimized case for ASCII
        // if ((c >= 0x1c && c <= 0x20) || (c >= 0x9 && c <= 0xd)) {
        //     return true;
        // }
        // if (c == 0x1680) {
        //     return true;
        // }
        // if (c < 0x2000 || c == 0x2007) {
        //     return false;
        // }
        // return c <= 0x200b || c == 0x2028 || c == 0x2029 || c == 0x3000;
        return UCharacter.isWhitespace(c);
        // END android-changed
    
public static booleanisWhitespace(int codePoint)
Indicates whether the specified code point is a whitespace character in Java.

param
codePoint the code point to check.
return
{@code true} if the supplied {@code c} is a whitespace character in Java; {@code false} otherwise.
since
Android 1.0

        //FIXME depends on ICU when the codePoint is '\u2007'
        return UCharacter.isWhitespace(codePoint);
    
public static intoffsetByCodePoints(java.lang.CharSequence seq, int index, int codePointOffset)
Determines the index in the specified character sequence that is offset {@code codePointOffset} code points from {@code index}.

param
seq the character sequence to find the index in.
param
index the start index in {@code seq}.
param
codePointOffset the number of code points to look backwards or forwards; may be a negative or positive value.
return
the index in {@code seq} that is {@code codePointOffset} code points away from {@code index}.
throws
IndexOutOfBoundsException if {@code index < 0}, {@code index} is greater than the length of {@code seq}, or if there are not enough values in {@code seq} to skip {@code codePointOffset} code points forwards or backwards (if {@code codePointOffset} is negative) from {@code index}.
since
Android 1.0

        if (seq == null) {
            throw new NullPointerException();
        }
        int len = seq.length();
        if (index < 0 || index > len) {
            throw new IndexOutOfBoundsException();
        }

        if (codePointOffset == 0) {
            return index;
        }

        if (codePointOffset > 0) {
            int codePoints = codePointOffset;
            int i = index;
            while (codePoints > 0) {
                codePoints--;
                if (i >= len) {
                    throw new IndexOutOfBoundsException();
                }
                if (isHighSurrogate(seq.charAt(i))) {
                    int next = i + 1;
                    if (next < len && isLowSurrogate(seq.charAt(next))) {
                        i++;
                    }
                }
                i++;
            }
            return i;
        }

        assert codePointOffset < 0;
        int codePoints = -codePointOffset;
        int i = index;
        while (codePoints > 0) {
            codePoints--;
            i--;
            if (i < 0) {
                throw new IndexOutOfBoundsException();
            }
            if (isLowSurrogate(seq.charAt(i))) {
                int prev = i - 1;
                if (prev >= 0 && isHighSurrogate(seq.charAt(prev))) {
                    i--;
                }
            }
        }
        return i;
    
public static intoffsetByCodePoints(char[] seq, int start, int count, int index, int codePointOffset)
Determines the index in a subsequence of the specified character array that is offset {@code codePointOffset} code points from {@code index}. The subsequence is delineated by {@code start} and {@code count}.

param
seq the character array to find the index in.
param
start the inclusive index that marks the beginning of the subsequence.
param
count the number of {@code char} values to include within the subsequence.
param
index the start index in the subsequence of the char array.
param
codePointOffset the number of code points to look backwards or forwards; may be a negative or positive value.
return
the index in {@code seq} that is {@code codePointOffset} code points away from {@code index}.
throws
IndexOutOfBoundsException if {@code start < 0}, {@code count < 0}, {@code index < start}, {@code index > start + count}, {@code start + count} is greater than the length of {@code seq}, or if there are not enough values in {@code seq} to skip {@code codePointOffset} code points forward or backward (if {@code codePointOffset} is negative) from {@code index}.
since
Android 1.0

        if (seq == null) {
            throw new NullPointerException();
        }
        int end = start + count;
        if (start < 0 || count < 0 || end > seq.length || index < start
                || index > end) {
            throw new IndexOutOfBoundsException();
        }

        if (codePointOffset == 0) {
            return index;
        }

        if (codePointOffset > 0) {
            int codePoints = codePointOffset;
            int i = index;
            while (codePoints > 0) {
                codePoints--;
                if (i >= end) {
                    throw new IndexOutOfBoundsException();
                }
                if (isHighSurrogate(seq[i])) {
                    int next = i + 1;
                    if (next < end && isLowSurrogate(seq[next])) {
                        i++;
                    }
                }
                i++;
            }
            return i;
        }

        assert codePointOffset < 0;
        int codePoints = -codePointOffset;
        int i = index;
        while (codePoints > 0) {
            codePoints--;
            i--;
            if (i < start) {
                throw new IndexOutOfBoundsException();
            }
            if (isLowSurrogate(seq[i])) {
                int prev = i - 1;
                if (prev >= start && isHighSurrogate(seq[prev])) {
                    i--;
                }
            }
        }
        return i;
    
public static charreverseBytes(char c)
Reverses the order of the first and second byte in the specified character.

param
c the character to reverse.
return
the character with reordered bytes.
since
Android 1.0

        return (char)((c<<8) | (c>>8));
    
public static inttoChars(int codePoint, char[] dst, int dstIndex)
Converts the specified Unicode code point into a UTF-16 encoded sequence and copies the value(s) into the char array {@code dst}, starting at index {@code dstIndex}.

param
codePoint the Unicode code point to encode.
param
dst the destination array to copy the encoded value into.
param
dstIndex the index in {@code dst} from where to start copying.
return
the number of {@code char} value units copied into {@code dst}.
throws
IllegalArgumentException if {@code codePoint} is not a valid Unicode code point.
throws
IndexOutOfBoundsException if {@code dstIndex} is negative, greater than or equal to {@code dst.length} or equals {@code dst.length - 1} when {@code codePoint} is a {@link #isSupplementaryCodePoint(int) supplementary code point}.
since
Android 1.0

        if (!isValidCodePoint(codePoint)) {
            throw new IllegalArgumentException();
        }
        if (dst == null) {
            throw new NullPointerException();
        }
        if (dstIndex < 0 || dstIndex >= dst.length) {
            throw new IndexOutOfBoundsException();
        }

        if (isSupplementaryCodePoint(codePoint)) {
            if (dstIndex == dst.length - 1) {
                throw new IndexOutOfBoundsException();
            }
            // See RFC 2781, Section 2.1
            // http://www.faqs.org/rfcs/rfc2781.html
            int cpPrime = codePoint - 0x10000;
            int high = 0xD800 | ((cpPrime >> 10) & 0x3FF);
            int low = 0xDC00 | (cpPrime & 0x3FF);
            dst[dstIndex] = (char) high;
            dst[dstIndex + 1] = (char) low;
            return 2;
        }

        dst[dstIndex] = (char) codePoint;
        return 1;
    
public static char[]toChars(int codePoint)
Converts the specified Unicode code point into a UTF-16 encoded sequence and returns it as a char array.

param
codePoint the Unicode code point to encode.
return
the UTF-16 encoded char sequence. If {@code codePoint} is a {@link #isSupplementaryCodePoint(int) supplementary code point}, then the returned array contains two characters, otherwise it contains just one character.
throws
IllegalArgumentException if {@code codePoint} is not a valid Unicode code point.
since
Android 1.0

        if (!isValidCodePoint(codePoint)) {
            throw new IllegalArgumentException();
        }

        if (isSupplementaryCodePoint(codePoint)) {
            int cpPrime = codePoint - 0x10000;
            int high = 0xD800 | ((cpPrime >> 10) & 0x3FF);
            int low = 0xDC00 | (cpPrime & 0x3FF);
            return new char[] { (char) high, (char) low };
        }
        return new char[] { (char) codePoint };
    
public static inttoCodePoint(char high, char low)
Converts a surrogate pair into a Unicode code point. This method assumes that the pair are valid surrogates. If the pair are not valid surrogates, then the result is indeterminate. The {@link #isSurrogatePair(char, char)} method should be used prior to this method to validate the pair.

param
high the high surrogate unit.
param
low the low surrogate unit.
return
the Unicode code point corresponding to the surrogate unit pair.
see
#isSurrogatePair(char, char)
since
Android 1.0

        // See RFC 2781, Section 2.2
        // http://www.faqs.org/rfcs/rfc2781.html
        int h = (high & 0x3FF) << 10;
        int l = low & 0x3FF;
        return (h | l) + 0x10000;
    
public static chartoLowerCase(char c)
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 {@code c} is an upper case character then its lower case counterpart, otherwise just {@code c}.
since
Android 1.0

        // BEGIN android-changed
        // // Optimized case for ASCII
        // if ('A' <= c && c <= 'Z') {
        //     return (char) (c + ('a' - 'A'));
        // }
        // if (c < 128) {
        //     return c;
        // }
        // 
        // int result = BinarySearch.binarySearchRange(lowercaseKeys, c);
        // if (result >= 0) {
        //     boolean by2 = false;
        //     char start = lowercaseKeys.charAt(result);
        //     char end = lowercaseValues[result * 2];
        //     if ((start & 0x8000) != (end & 0x8000)) {
        //         end ^= 0x8000;
        //         by2 = true;
        //     }
        //     if (c <= end) {
        //         if (by2 && (c & 1) != (start & 1)) {
        //             return c;
        //         }
        //         char mapping = lowercaseValues[result * 2 + 1];
        //         return (char) (c + mapping);
        //     }
        // }
        // return c;
        return (char)UCharacter.toLowerCase(c);
        // END android-changed
    
public static inttoLowerCase(int codePoint)
Returns the lower case equivalent for the specified code point if it is an upper case letter. Otherwise, the specified code point is returned unchanged.

param
codePoint the code point to check.
return
if {@code codePoint} is an upper case character then its lower case counterpart, otherwise just {@code codePoint}.
since
Android 1.0

        return UCharacter.toLowerCase(codePoint);
    
public java.lang.StringtoString()

        return String.valueOf(value);
    
public static java.lang.StringtoString(char value)
Converts the specified character to its string representation.

param
value the character to convert.
return
the character converted to a string.
since
Android 1.0

        return String.valueOf(value);
    
public static chartoTitleCase(char c)
Returns the title case equivalent for the specified character if it exists. Otherwise, the specified character is returned unchanged.

param
c the character to convert.
return
the title case equivalent of {@code c} if it exists, otherwise {@code c}.
since
Android 1.0

        // BEGIN android-changed
        // if (isTitleCase(c)) {
        //     return c;
        // }
        // int result = BinarySearch.binarySearch(titlecaseKeys, c);
        // if (result >= 0) {
        //     return titlecaseValues[result];
        // }
        // return toUpperCase(c);
        return (char)UCharacter.toTitleCase(c);
        // ENd android-changed
    
public static inttoTitleCase(int codePoint)
Returns the title case equivalent for the specified code point if it exists. Otherwise, the specified code point is returned unchanged.

param
codePoint the code point to convert.
return
the title case equivalent of {@code codePoint} if it exists, otherwise {@code codePoint}.
since
Android 1.0

        return UCharacter.toTitleCase(codePoint);
    
public static chartoUpperCase(char c)
Returns the upper case equivalent for the specified character if the character is a lower case letter. Otherwise, the specified character is returned unchanged.

param
c the character to convert.
return
if {@code c} is a lower case character then its upper case counterpart, otherwise just {@code c}.
since
Android 1.0

        // BEGIN android-changed
        // // Optimized case for ASCII
        // if ('a' <= c && c <= 'z') {
        //     return (char) (c - ('a' - 'A'));
        // }
        // if (c < 128) {
        //     return c;
        // }
        // 
        // int result = BinarySearch.binarySearchRange(uppercaseKeys, c);
        // if (result >= 0) {
        //     boolean by2 = false;
        //     char start = uppercaseKeys.charAt(result);
        //     char end = uppercaseValues[result * 2];
        //     if ((start & 0x8000) != (end & 0x8000)) {
        //         end ^= 0x8000;
        //         by2 = true;
        //     }
        //     if (c <= end) {
        //         if (by2 && (c & 1) != (start & 1)) {
        //             return c;
        //         }
        //         char mapping = uppercaseValues[result * 2 + 1];
        //         return (char) (c + mapping);
        //     }
        // }
        // return c;
        return (char)UCharacter.toUpperCase(c);
        // END android-changed
    
public static inttoUpperCase(int codePoint)
Returns the upper case equivalent for the specified code point if the code point is a lower case letter. Otherwise, the specified code point is returned unchanged.

param
codePoint the code point to convert.
return
if {@code codePoint} is a lower case character then its upper case counterpart, otherwise just {@code codePoint}.
since
Android 1.0

        return UCharacter.toUpperCase(codePoint);
    
public static java.lang.CharactervalueOf(char c)
Returns a {@code Character} instance for the {@code char} value passed. For ASCII/Latin-1 characters (and generally all characters with a Unicode value up to 512), this method should be used instead of the constructor, as it maintains a cache of corresponding {@code Character} instances.

param
c the char value for which to get a {@code Character} instance.
return
the {@code Character} instance for {@code c}.
since
Android 1.0

        if (c >= CACHE_LEN ) {
            return new Character(c);
        }
        return valueOfCache.CACHE[c];