equal
deleted
inserted
replaced
52 * The file and its description are available from the Unicode Consortium at: |
52 * The file and its description are available from the Unicode Consortium at: |
53 * <ul> |
53 * <ul> |
54 * <li><a href="http://www.unicode.org">http://www.unicode.org</a> |
54 * <li><a href="http://www.unicode.org">http://www.unicode.org</a> |
55 * </ul> |
55 * </ul> |
56 * |
56 * |
57 * <h4><a name="unicode">Unicode Character Representations</a></h4> |
57 * <h3><a name="unicode">Unicode Character Representations</a></h3> |
58 * |
58 * |
59 * <p>The {@code char} data type (and therefore the value that a |
59 * <p>The {@code char} data type (and therefore the value that a |
60 * {@code Character} object encapsulates) are based on the |
60 * {@code Character} object encapsulates) are based on the |
61 * original Unicode specification, which defined characters as |
61 * original Unicode specification, which defined characters as |
62 * fixed-width 16-bit entities. The Unicode Standard has since been |
62 * fixed-width 16-bit entities. The Unicode Standard has since been |
66 * (Refer to the <a |
66 * (Refer to the <a |
67 * href="http://www.unicode.org/reports/tr27/#notation"><i> |
67 * href="http://www.unicode.org/reports/tr27/#notation"><i> |
68 * definition</i></a> of the U+<i>n</i> notation in the Unicode |
68 * definition</i></a> of the U+<i>n</i> notation in the Unicode |
69 * Standard.) |
69 * Standard.) |
70 * |
70 * |
71 * <p><a name="BMP">The set of characters from U+0000 to U+FFFF is |
71 * <p><a name="BMP">The set of characters from U+0000 to U+FFFF</a> is |
72 * sometimes referred to as the <em>Basic Multilingual Plane (BMP)</em>. |
72 * sometimes referred to as the <em>Basic Multilingual Plane (BMP)</em>. |
73 * <a name="supplementary">Characters</a> whose code points are greater |
73 * <a name="supplementary">Characters</a> whose code points are greater |
74 * than U+FFFF are called <em>supplementary character</em>s. The Java |
74 * than U+FFFF are called <em>supplementary character</em>s. The Java |
75 * platform uses the UTF-16 representation in {@code char} arrays and |
75 * platform uses the UTF-16 representation in {@code char} arrays and |
76 * in the {@code String} and {@code StringBuffer} classes. In |
76 * in the {@code String} and {@code StringBuffer} classes. In |
4597 * Returns a hash code for a {@code char} value; compatible with |
4597 * Returns a hash code for a {@code char} value; compatible with |
4598 * {@code Character.hashCode()}. |
4598 * {@code Character.hashCode()}. |
4599 * |
4599 * |
4600 * @since 1.8 |
4600 * @since 1.8 |
4601 * |
4601 * |
|
4602 * @param value The {@code char} for which to return a hash code. |
4602 * @return a hash code value for a {@code char} value. |
4603 * @return a hash code value for a {@code char} value. |
4603 */ |
4604 */ |
4604 public static int hashCode(char value) { |
4605 public static int hashCode(char value) { |
4605 return (int)value; |
4606 return (int)value; |
4606 } |
4607 } |
6635 |
6636 |
6636 /** |
6637 /** |
6637 * Determines if the specified character is ISO-LATIN-1 white space. |
6638 * Determines if the specified character is ISO-LATIN-1 white space. |
6638 * This method returns {@code true} for the following five |
6639 * This method returns {@code true} for the following five |
6639 * characters only: |
6640 * characters only: |
6640 * <table> |
6641 * <table summary="truechars"> |
6641 * <tr><td>{@code '\t'}</td> <td>{@code U+0009}</td> |
6642 * <tr><td>{@code '\t'}</td> <td>{@code U+0009}</td> |
6642 * <td>{@code HORIZONTAL TABULATION}</td></tr> |
6643 * <td>{@code HORIZONTAL TABULATION}</td></tr> |
6643 * <tr><td>{@code '\n'}</td> <td>{@code U+000A}</td> |
6644 * <tr><td>{@code '\n'}</td> <td>{@code U+000A}</td> |
6644 * <td>{@code NEW LINE}</td></tr> |
6645 * <td>{@code NEW LINE}</td></tr> |
6645 * <tr><td>{@code '\f'}</td> <td>{@code U+000C}</td> |
6646 * <tr><td>{@code '\f'}</td> <td>{@code U+000C}</td> |
7172 |
7173 |
7173 /** |
7174 /** |
7174 * Returns the value obtained by reversing the order of the bytes in the |
7175 * Returns the value obtained by reversing the order of the bytes in the |
7175 * specified <tt>char</tt> value. |
7176 * specified <tt>char</tt> value. |
7176 * |
7177 * |
|
7178 * @param ch The {@code char} of which to reverse the byte order. |
7177 * @return the value obtained by reversing (or, equivalently, swapping) |
7179 * @return the value obtained by reversing (or, equivalently, swapping) |
7178 * the bytes in the specified <tt>char</tt> value. |
7180 * the bytes in the specified <tt>char</tt> value. |
7179 * @since 1.5 |
7181 * @since 1.5 |
7180 */ |
7182 */ |
7181 public static char reverseBytes(char ch) { |
7183 public static char reverseBytes(char ch) { |