提交 df55cc64 编写于 作者: C coffeys

8216396: Support new Japanese era and new currency code points in java.lang.Character for Java SE 8

Reviewed-by: chegar, naoto, rriggs, coffeys
Contributed-by: deepak.kejriwal@oracle.com
上级 6c78e3d5
/*
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -32,27 +32,41 @@ import java.util.Locale;
/**
* The {@code Character} class wraps a value of the primitive
* type {@code char} in an object. An object of type
* type {@code char} in an object. An object of class
* {@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 6.2.0.
* In addition, this class provides a large number of static methods for
* determining a character's category (lowercase letter, digit, etc.)
* and for converting characters from uppercase to lowercase and vice
* versa.
*
* <h3><a id="conformance">Unicode Conformance</a></h3>
* <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.
* The fields and methods of class {@code Character} are defined in terms
* of character information from the Unicode Standard, specifically the
* <i>UnicodeData</i> file that is part of the Unicode Character Database.
* This file specifies properties including name and category for every
* assigned Unicode code point or character range. The file is available
* from the Unicode Consortium at
* <a href="http://www.unicode.org">http://www.unicode.org</a>.
* <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>
* The Java SE 8 Platform uses character information from version 6.2
* of the Unicode Standard, with two extensions. First, the Java SE 8 Platform
* allows an implementation of class {@code Character} to use the Japanese Era
* code point, {@code U+32FF}, from the first version of the Unicode Standard
* after 6.2 that assigns the code point. Second, in recognition of the fact
* that new currencies appear frequently, the Java SE 8 Platform allows an
* implementation of class {@code Character} to use the Currency Symbols
* block from version 10.0 of the Unicode Standard. Consequently, the
* behavior of fields and methods of class {@code Character} may vary across
* implementations of the Java SE 8 Platform when processing the aforementioned
* code points ( outside of version 6.2 ), except for the following methods
* that define Java identifiers:
* {@link #isJavaIdentifierStart(int)}, {@link #isJavaIdentifierStart(char)},
* {@link #isJavaIdentifierPart(int)}, and {@link #isJavaIdentifierPart(char)}.
* Code points in Java identifiers must be drawn from version 6.2 of
* the Unicode Standard.
*
* <h3><a name="unicode">Unicode Character Representations</a></h3>
*
......@@ -5859,7 +5873,7 @@ class Character implements java.io.Serializable, Comparable<Character> {
* character in a Java identifier.
* <p>
* A character may start a Java identifier if and only if
* one of the following is true:
* one of the following conditions is true:
* <ul>
* <li> {@link #isLetter(char) isLetter(ch)} returns {@code true}
* <li> {@link #getType(char) getType(ch)} returns {@code LETTER_NUMBER}
......@@ -5867,6 +5881,9 @@ class Character implements java.io.Serializable, Comparable<Character> {
* <li> {@code ch} is a connecting punctuation character (such as {@code '_'}).
* </ul>
*
* These conditions are tested against the character information from version
* 6.2 of the Unicode Standard.
*
* @param ch the character to be tested.
* @return {@code true} if the character may start a Java
* identifier; {@code false} otherwise.
......@@ -5889,7 +5906,7 @@ class Character implements java.io.Serializable, Comparable<Character> {
* identifier as other than the first character.
* <p>
* A character may be part of a Java identifier if and only if any
* of the following are true:
* of the following conditions are true:
* <ul>
* <li> it is a letter
* <li> it is a currency symbol (such as {@code '$'})
......@@ -5902,6 +5919,9 @@ class Character implements java.io.Serializable, Comparable<Character> {
* {@code true} for the character.
* </ul>
*
* These conditions are tested against the character information from version
* 6.2 of the Unicode Standard.
*
* @param ch the character to be tested.
* @return {@code true} if the character may be part of a
* Java identifier; {@code false} otherwise.
......@@ -5979,6 +5999,9 @@ class Character implements java.io.Serializable, Comparable<Character> {
* <li> {@code ch} is a connecting punctuation character (such as {@code '_'}).
* </ul>
*
* These conditions are tested against the character information from version
* 6.2 of the Unicode Standard.
*
* <p><b>Note:</b> This method cannot handle <a
* href="#supplementary"> supplementary characters</a>. To support
* all Unicode characters, including supplementary characters, use
......@@ -6013,6 +6036,9 @@ class Character implements java.io.Serializable, Comparable<Character> {
* (such as {@code '_'}).
* </ul>
*
* These conditions are tested against the character information from version
* 6.2 of the Unicode Standard.
*
* @param codePoint the character (Unicode code point) to be tested.
* @return {@code true} if the character may start a Java identifier;
* {@code false} otherwise.
......@@ -6031,7 +6057,7 @@ class Character implements java.io.Serializable, Comparable<Character> {
* identifier as other than the first character.
* <p>
* A character may be part of a Java identifier if any of the following
* are true:
* conditions are true:
* <ul>
* <li> it is a letter
* <li> it is a currency symbol (such as {@code '$'})
......@@ -6044,6 +6070,9 @@ class Character implements java.io.Serializable, Comparable<Character> {
* {@code true} for the character
* </ul>
*
* These conditions are tested against the character information from version
* 6.2 of the Unicode Standard.
*
* <p><b>Note:</b> This method cannot handle <a
* href="#supplementary"> supplementary characters</a>. To support
* all Unicode characters, including supplementary characters, use
......@@ -6068,7 +6097,7 @@ class Character implements java.io.Serializable, Comparable<Character> {
* identifier as other than the first character.
* <p>
* A character may be part of a Java identifier if any of the following
* are true:
* conditions are true:
* <ul>
* <li> it is a letter
* <li> it is a currency symbol (such as {@code '$'})
......@@ -6079,9 +6108,12 @@ class Character implements java.io.Serializable, Comparable<Character> {
* <li> it is a non-spacing mark
* <li> {@link #isIdentifierIgnorable(int)
* isIdentifierIgnorable(codePoint)} returns {@code true} for
* the character
* the code point
* </ul>
*
* These conditions are tested against the character information from version
* 6.2 of the Unicode Standard.
*
* @param codePoint the character (Unicode code point) to be tested.
* @return {@code true} if the character may be part of a
* Java identifier; {@code false} otherwise.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册