Returns the value of this {@code Character} object. @return the primitive {@code char} value represented by this object.
Determines the number of {@code char} values needed to represent the specified character (Unicode code point). If the specified character is equal to or greater than 0x10000, then the method returns 2. Otherwise, the method returns 1.
Returns the code point at the given index of the {@code CharSequence}. If the {@code char} value at the given index in the {@code CharSequence} is in the high-surrogate range, the following index is less than the length of the {@code CharSequence}, and the {@code char} value at the following index is in the low-surrogate range, then the supplementary code point corresponding to this surrogate pair is returned. Otherwise, the {@code char} value at the given index is returned.
Returns the leading surrogate (a <a href="http://www.unicode.org/glossary/#high_surrogate_code_unit"> high surrogate code unit</a>) of the <a href="http://www.unicode.org/glossary/#surrogate_pair"> surrogate pair</a> representing the specified supplementary character (Unicode code point) in the UTF-16 encoding. If the specified character is not a <a href="Character.html#supplementary">supplementary character</a>, an unspecified {@code char} is returned.
Determines whether the specified character (Unicode code point) is in the <a href="#BMP">Basic Multilingual Plane (BMP)</a>. Such code points can be represented using a single {@code char}.
Determines if the given {@code char} value is a <a href="http://www.unicode.org/glossary/#high_surrogate_code_unit"> Unicode high-surrogate code unit</a> (also known as <i>leading-surrogate code unit</i>).
Determines if the specified character is an ISO control character. A character is considered to be an ISO control character if its code is in the range {@code '\u005Cu0000'} through {@code '\u005Cu001F'} or in the range {@code '\u005Cu007F'} through {@code '\u005Cu009F'}.
Determines if the referenced character (Unicode code point) is an ISO control character. A character is considered to be an ISO control character if its code is in the range {@code '\u005Cu0000'} through {@code '\u005Cu001F'} or in the range {@code '\u005Cu007F'} through {@code '\u005Cu009F'}.
Determines if the specified character is a letter. <p> A character is considered to be a letter if its general category type, provided by {@code Character.getType(ch)}, is any of the following: <ul> <li> {@code UPPERCASE_LETTER} <li> {@code LOWERCASE_LETTER} <li> {@code TITLECASE_LETTER} <li> {@code MODIFIER_LETTER} <li> {@code OTHER_LETTER} </ul>
Determines if the given {@code char} value is a <a href="http://www.unicode.org/glossary/#low_surrogate_code_unit"> Unicode low-surrogate code unit</a> (also known as <i>trailing-surrogate code unit</i>).
Determines whether the specified code point is a valid <a href="http://www.unicode.org/glossary/#code_point"> Unicode code point value</a>.
Returns the trailing surrogate (a <a href="http://www.unicode.org/glossary/#low_surrogate_code_unit"> low surrogate code unit</a>) of the <a href="http://www.unicode.org/glossary/#surrogate_pair"> surrogate pair</a> representing the specified supplementary character (Unicode code point) in the UTF-16 encoding. If the specified character is not a <a href="Character.html#supplementary">supplementary character</a>, an unspecified {@code char} is returned.
Converts the specified character (Unicode code point) to its UTF-16 representation stored in a {@code char} array. If the specified code point is a BMP (Basic Multilingual Plane or Plane 0) value, the resulting {@code char} array has the same value as {@code codePoint}. If the specified code point is a supplementary code point, the resulting {@code char} array has the corresponding surrogate pair.
Converts the specified surrogate pair to its supplementary code point value. This method does not validate the specified surrogate pair. The caller must validate it using {@link #isSurrogatePair(char, char) isSurrogatePair} if necessary.
Returns a {@code Character} instance representing the specified {@code char} value. If a new {@code Character} instance is not required, this method should generally be used in preference to the constructor {@link #Character(char)}, as this method is likely to yield significantly better space and time performance by caching frequently requested values.
General category "Mc" in the Unicode specification.
General category "Pc" in the Unicode specification.
General category "Cc" in the Unicode specification.
General category "Sc" in the Unicode specification.
General category "Pd" in the Unicode specification.
General category "Nd" in the Unicode specification.
Weak bidirectional character type "AN" in the Unicode specification.
Weak bidirectional character type "BN" in the Unicode specification.
Weak bidirectional character type "CS" in the Unicode specification.
Weak bidirectional character type "EN" in the Unicode specification.
Weak bidirectional character type "ES" in the Unicode specification.
Weak bidirectional character type "ET" in the Unicode specification.
Strong bidirectional character type "L" in the Unicode specification.
Strong bidirectional character type "LRE" in the Unicode specification.
Strong bidirectional character type "LRO" in the Unicode specification.
Weak bidirectional character type "NSM" in the Unicode specification.
Neutral bidirectional character type "ON" in the Unicode specification.
Neutral bidirectional character type "B" in the Unicode specification.
Weak bidirectional character type "PDF" in the Unicode specification.
Strong bidirectional character type "R" in the Unicode specification.
* Strong bidirectional character type "AL" in the Unicode specification.
Strong bidirectional character type "RLE" in the Unicode specification.
Strong bidirectional character type "RLO" in the Unicode specification.
Neutral bidirectional character type "S" in the Unicode specification.
Undefined bidirectional character type. Undefined {@code char} values have undefined directionality in the Unicode specification.
Neutral bidirectional character type "WS" in the Unicode specification.
General category "Me" in the Unicode specification.
General category "Pe" in the Unicode specification.
Error flag. Use int (code point) to avoid confusion with U+FFFF.
General category "Pf" in the Unicode specification.
General category "Cf" in the Unicode specification.
General category "Pi" in the Unicode specification.
General category "Nl" in the Unicode specification.
General category "Zl" in the Unicode specification.
General category "Ll" in the Unicode specification.
General category "Sm" in the Unicode specification.
The maximum value of a <a href="http://www.unicode.org/glossary/#code_point"> Unicode code point</a>, constant {@code U+10FFFF}.
The maximum value of a <a href="http://www.unicode.org/glossary/#high_surrogate_code_unit"> Unicode high-surrogate code unit</a> in the UTF-16 encoding, constant {@code '\u005CuDBFF'}. A high-surrogate is also known as a <i>leading-surrogate</i>.
The maximum value of a <a href="http://www.unicode.org/glossary/#low_surrogate_code_unit"> Unicode low-surrogate code unit</a> in the UTF-16 encoding, constant {@code '\u005CuDFFF'}. A low-surrogate is also known as a <i>trailing-surrogate</i>.
The maximum radix available for conversion to and from strings. The constant value of this field is the largest value permitted for the radix argument in radix-conversion methods such as the {@code digit} method, the {@code forDigit} method, and the {@code toString} method of class {@code Integer}.
The maximum value of a Unicode surrogate code unit in the UTF-16 encoding, constant {@code '\u005CuDFFF'}.
The minimum value of a <a href="http://www.unicode.org/glossary/#code_point"> Unicode code point</a>, constant {@code U+0000}.
The minimum value of a <a href="http://www.unicode.org/glossary/#high_surrogate_code_unit"> Unicode high-surrogate code unit</a> in the UTF-16 encoding, constant {@code '\u005CuD800'}. A high-surrogate is also known as a <i>leading-surrogate</i>.
The minimum value of a <a href="http://www.unicode.org/glossary/#low_surrogate_code_unit"> Unicode low-surrogate code unit</a> in the UTF-16 encoding, constant {@code '\u005CuDC00'}. A low-surrogate is also known as a <i>trailing-surrogate</i>.
The minimum radix available for conversion to and from strings. The constant value of this field is the smallest value permitted for the radix argument in radix-conversion methods such as the {@code digit} method, the {@code forDigit} method, and the {@code toString} method of class {@code Integer}.
The minimum value of a <a href="http://www.unicode.org/glossary/#supplementary_code_point"> Unicode supplementary code point</a>, constant {@code U+10000}.
The minimum value of a Unicode surrogate code unit in the UTF-16 encoding, constant {@code '\u005CuD800'}.
The constant value of this field is the smallest value of type {@code char}, {@code '\u005Cu0000'}.
General category "Lm" in the Unicode specification.
General category "Sk" in the Unicode specification.
General category "Mn" in the Unicode specification.
General category "Lo" in the Unicode specification.
General category "No" in the Unicode specification.
General category "Po" in the Unicode specification.
General category "So" in the Unicode specification.
General category "Zp" in the Unicode specification.
General category "Co" in the Unicode specification.
General category "Zs" in the Unicode specification.
General category "Ps" in the Unicode specification.
General category "Cs" in the Unicode specification.
General category "Lt" in the Unicode specification.
General category "Cn" in the Unicode specification.
General category "Lu" in the Unicode specification.
The {@code Character} class wraps a value of the primitive type {@code char} in an object. An object of type {@code Character} contains a single field whose type is {@code char}. <p> In addition, this class provides several methods for determining a character's category (lowercase letter, digit, etc.) and for converting characters from uppercase to lowercase and vice versa. <p> Character information is based on the Unicode Standard, version 8.0.0. <p> The methods and data of class {@code Character} are defined by the information in the <i>UnicodeData</i> file that is part of the Unicode Character Database maintained by the Unicode Consortium. This file specifies various properties including name and general category for every defined Unicode code point or character range. <p> The file and its description are available from the Unicode Consortium at: <ul> <li><a href="http://www.unicode.org">http://www.unicode.org</a> </ul>
<h3><a id="unicode">Unicode Character Representations</a></h3>
<p>The {@code char} data type (and therefore the value that a {@code Character} object encapsulates) are based on the original Unicode specification, which defined characters as fixed-width 16-bit entities. The Unicode Standard has since been changed to allow for characters whose representation requires more than 16 bits. The range of legal <em>code point</em>s is now U+0000 to U+10FFFF, known as <em>Unicode scalar value</em>. (Refer to the <a href="http://www.unicode.org/reports/tr27/#notation"><i> definition</i></a> of the U+<i>n</i> notation in the Unicode Standard.)
<p><a id="BMP">The set of characters from U+0000 to U+FFFF</a> is sometimes referred to as the <em>Basic Multilingual Plane (BMP)</em>. <a id="supplementary">Characters</a> whose code points are greater than U+FFFF are called <em>supplementary character</em>s. The Java platform uses the UTF-16 representation in {@code char} arrays and in the {@code string} and {@code StringBuffer} classes. In this representation, supplementary characters are represented as a pair of {@code char} values, the first from the <em>high-surrogates</em> range, (\uD800-\uDBFF), the second from the <em>low-surrogates</em> range (\uDC00-\uDFFF).
<p>A {@code char} value, therefore, represents Basic Multilingual Plane (BMP) code points, including the surrogate code points, or code units of the UTF-16 encoding. An {@code int} value represents all Unicode code points, including supplementary code points. The lower (least significant) 21 bits of {@code int} are used to represent Unicode code points and the upper (most significant) 11 bits must be zero. Unless otherwise specified, the behavior with respect to supplementary characters and surrogate {@code char} values is as follows:
<ul> <li>The methods that only accept a {@code char} value cannot support supplementary characters. They treat {@code char} values from the surrogate ranges as undefined characters. For example, {@code Character.isLetter('\u005CuD840')} returns {@code false}, even though this specific value if followed by any low-surrogate value in a string would represent a letter.
<li>The methods that accept an {@code int} value support all Unicode characters, including supplementary characters. For example, {@code Character.isLetter(0x2F81A)} returns {@code true} because the code point value represents a letter (a CJK ideograph). </ul>
<p>In the Java SE API documentation, <em>Unicode code point</em> is used for character values in the range between U+0000 and U+10FFFF, and <em>Unicode code unit</em> is used for 16-bit {@code char} values that are code units of the <em>UTF-16</em> encoding. For more information on Unicode terminology, refer to the <a href="http://www.unicode.org/glossary/">Unicode Glossary</a>.
@author Lee Boynton @author Guy Steele @author Akira Tanaka @author Martin Buchholz @author Ulf Zibis