Retrieves the constant that corresponds to the specified block name. The block names are defined by the Unicode 4.0.1 specification in the Blocks-4.0.1.txt file. Block names may be one of the following: Canonical block name, as defined by the Unicode specification; case-insensit
(String blockName)
| 1893 | * @since 1.5 |
| 1894 | */ |
| 1895 | public static UnicodeBlock forName(String blockName) { |
| 1896 | if (blockName == null) { |
| 1897 | throw new NullPointerException(); |
| 1898 | } |
| 1899 | UnicodeBlock match = BLOCKS_BY_NAME.get(blockName); |
| 1900 | if (match == null) { |
| 1901 | throw new IllegalArgumentException(); |
| 1902 | } |
| 1903 | return match; |
| 1904 | } |
| 1905 | |
| 1906 | /** |
| 1907 | * Gets the constant for the Unicode block that contains the specified |