Home | History | Annotate | Download | only in text
      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) 2012-2015, International Business Machines Corporation and    *
      7  * others. All Rights Reserved.                                                *
      8  *******************************************************************************
      9  */
     10 package android.icu.text;
     11 
     12 /**
     13  * Display context settings.
     14  * Note, the specific numeric values are internal and may change.
     15  */
     16 public enum DisplayContext {
     17     /**
     18      * ================================
     19      * Settings for DIALECT_HANDLING (use one)
     20      */
     21     /**
     22      * A possible setting for DIALECT_HANDLING:
     23      * use standard names when generating a locale name,
     24      * e.g. en_GB displays as 'English (United Kingdom)'.
     25      */
     26     STANDARD_NAMES(Type.DIALECT_HANDLING, 0),
     27     /**
     28      * A possible setting for DIALECT_HANDLING:
     29      * use dialect names, when generating a locale name,
     30      * e.g. en_GB displays as 'British English'.
     31      */
     32     DIALECT_NAMES(Type.DIALECT_HANDLING, 1),
     33     /**
     34      * ================================
     35      * Settings for CAPITALIZATION (use one)
     36      */
     37     /**
     38      * A possible setting for CAPITALIZATION:
     39      * The capitalization context to be used is unknown (this is the default value).
     40      */
     41     CAPITALIZATION_NONE(Type.CAPITALIZATION, 0),
     42     /**
     43      * A possible setting for CAPITALIZATION:
     44      * The capitalization context if a date, date symbol or display name is to be
     45      * formatted with capitalization appropriate for the middle of a sentence.
     46      */
     47     CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE(Type.CAPITALIZATION, 1),
     48     /**
     49      * A possible setting for CAPITALIZATION:
     50      * The capitalization context if a date, date symbol or display name is to be
     51      * formatted with capitalization appropriate for the beginning of a sentence.
     52      */
     53     CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE(Type.CAPITALIZATION, 2),
     54     /**
     55      * A possible setting for CAPITALIZATION:
     56      * The capitalization context if a date, date symbol or display name is to be
     57      * formatted with capitalization appropriate for a user-interface list or menu item.
     58      */
     59     CAPITALIZATION_FOR_UI_LIST_OR_MENU(Type.CAPITALIZATION, 3),
     60     /**
     61      * A possible setting for CAPITALIZATION:
     62      * The capitalization context if a date, date symbol or display name is to be
     63      * formatted with capitalization appropriate for stand-alone usage such as an
     64      * isolated name on a calendar page.
     65      */
     66     CAPITALIZATION_FOR_STANDALONE(Type.CAPITALIZATION, 4),
     67     /**
     68      * ================================
     69      * Settings for DISPLAY_LENGTH (use one)
     70      */
     71     /**
     72      * A possible setting for DISPLAY_LENGTH:
     73      * use full names when generating a locale name,
     74      * e.g. "United States" for US.
     75      */
     76     LENGTH_FULL(Type.DISPLAY_LENGTH, 0),
     77     /**
     78      * A possible setting for DISPLAY_LENGTH:
     79      * use short names when generating a locale name,
     80      * e.g. "U.S." for US.
     81      */
     82     LENGTH_SHORT(Type.DISPLAY_LENGTH, 1),
     83     /**
     84      * ================================
     85      * Settings for SUBSTITUTE_HANDLING (choose one)
     86      */
     87     /**
     88      * A possible setting for SUBSTITUTE_HANDLING:
     89      * Returns a fallback value (e.g., the input code) when no data is available.
     90      * This is the default behavior.
     91      */
     92     SUBSTITUTE(Type.SUBSTITUTE_HANDLING, 0),
     93     /**
     94      * A possible setting for SUBSTITUTE_HANDLING:
     95      * Returns a null value when no data is available.
     96      */
     97     NO_SUBSTITUTE(Type.SUBSTITUTE_HANDLING, 1);
     98 
     99     /**
    100      * Type values for DisplayContext
    101      */
    102     public enum Type {
    103         /**
    104          * DIALECT_HANDLING can be set to STANDARD_NAMES or DIALECT_NAMES.
    105          */
    106         DIALECT_HANDLING,
    107         /**
    108          * CAPITALIZATION can be set to one of CAPITALIZATION_NONE through
    109          * CAPITALIZATION_FOR_STANDALONE.
    110          */
    111         CAPITALIZATION,
    112         /**
    113          * DISPLAY_LENGTH can be set to LENGTH_FULL or LENGTH_SHORT.
    114          */
    115         DISPLAY_LENGTH,
    116         /**
    117          * SUBSTITUTE_HANDLING can be set to SUBSTITUTE or NO_SUBSTITUTE.
    118          */
    119         SUBSTITUTE_HANDLING
    120     }
    121 
    122     private final Type type;
    123     private final int value;
    124     private DisplayContext(Type type, int value) {
    125         this.type = type;
    126         this.value = value;
    127     }
    128     /**
    129      * Get the Type part of the enum item
    130      * (e.g. CAPITALIZATION)
    131      */
    132     public Type type() {
    133         return type;
    134     }
    135     /**
    136      * Get the value part of the enum item
    137      * (e.g. CAPITALIZATION_FOR_STANDALONE)
    138      */
    139     public int value() {
    140         return value;
    141     }
    142 }
    143