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