1/**
2 *******************************************************************************
3 * Copyright (C) 1996-2004, International Business Machines Corporation and    *
4 * others. All Rights Reserved.                                                *
5 *******************************************************************************
6 */
7
8package com.ibm.icu.lang;
9
10import com.ibm.icu.lang.UCharacterEnums.ECharacterCategory;
11
12/**
13 * Enumerated Unicode category types from the UnicodeData.txt file.
14 * Used as return results from <a href=UCharacter.html>UCharacter</a>
15 * Equivalent to icu's UCharCategory.
16 * Refer to <a href="http://www.unicode.org/Public/UNIDATA/UCD.html">
17 * Unicode Consortium</a> for more information about UnicodeData.txt.
18 * <p>
19 * <em>NOTE:</em> the UCharacterCategory values are <em>not</em> compatible with
20 * those returned by java.lang.Character.getType.  UCharacterCategory values
21 * match the ones used in ICU4C, while java.lang.Character type
22 * values, though similar, skip the value 17.</p>
23 * <p>
24 * This class is not subclassable
25 * </p>
26 * @author Syn Wee Quek
27 * @stable ICU 2.1
28 */
29
30public final class UCharacterCategory implements ECharacterCategory
31{
32    /**
33     * Gets the name of the argument category
34     * @param category to retrieve name
35     * @return category name
36     * @stable ICU 2.1
37     */
38    public static String toString(int category)
39    {
40        switch (category) {
41        case UPPERCASE_LETTER :
42            return "Letter, Uppercase";
43        case LOWERCASE_LETTER :
44            return "Letter, Lowercase";
45        case TITLECASE_LETTER :
46            return "Letter, Titlecase";
47        case MODIFIER_LETTER :
48            return "Letter, Modifier";
49        case OTHER_LETTER :
50            return "Letter, Other";
51        case NON_SPACING_MARK :
52            return "Mark, Non-Spacing";
53        case ENCLOSING_MARK :
54            return "Mark, Enclosing";
55        case COMBINING_SPACING_MARK :
56            return "Mark, Spacing Combining";
57        case DECIMAL_DIGIT_NUMBER :
58            return "Number, Decimal Digit";
59        case LETTER_NUMBER :
60            return "Number, Letter";
61        case OTHER_NUMBER :
62            return "Number, Other";
63        case SPACE_SEPARATOR :
64            return "Separator, Space";
65        case LINE_SEPARATOR :
66            return "Separator, Line";
67        case PARAGRAPH_SEPARATOR :
68            return "Separator, Paragraph";
69        case CONTROL :
70            return "Other, Control";
71        case FORMAT :
72            return "Other, Format";
73        case PRIVATE_USE :
74            return "Other, Private Use";
75        case SURROGATE :
76            return "Other, Surrogate";
77        case DASH_PUNCTUATION :
78            return "Punctuation, Dash";
79        case START_PUNCTUATION :
80            return "Punctuation, Open";
81        case END_PUNCTUATION :
82            return "Punctuation, Close";
83        case CONNECTOR_PUNCTUATION :
84            return "Punctuation, Connector";
85        case OTHER_PUNCTUATION :
86            return "Punctuation, Other";
87        case MATH_SYMBOL :
88            return "Symbol, Math";
89        case CURRENCY_SYMBOL :
90            return "Symbol, Currency";
91        case MODIFIER_SYMBOL :
92            return "Symbol, Modifier";
93        case OTHER_SYMBOL :
94            return "Symbol, Other";
95        case INITIAL_PUNCTUATION :
96            return "Punctuation, Initial quote";
97        case FINAL_PUNCTUATION :
98            return "Punctuation, Final quote";
99        }
100        return "Unassigned";
101    }
102
103    // private constructor -----------------------------------------------
104    ///CLOVER:OFF
105    /**
106     * Private constructor to prevent initialisation
107     */
108    private UCharacterCategory()
109    {
110    }
111    ///CLOVER:ON
112}
113