1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html#License
3 /**
4 *******************************************************************************
5 * Copyright (C) 1996-2013, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 *******************************************************************************
8 */
9 
10 package com.ibm.icu.lang;
11 
12 import com.ibm.icu.lang.UCharacterEnums.ECharacterDirection;
13 
14 /**
15  * Enumerated Unicode character linguistic direction constants.
16  * Used as return results from <a href=UCharacter.html>UCharacter</a>
17  * <p>
18  * This class is not subclassable
19  * </p>
20  * @author Syn Wee Quek
21  * @stable ICU 2.1
22  */
23 
24 public final class UCharacterDirection implements ECharacterDirection {
25 
26     // private constructor =========================================
27     ///CLOVER:OFF
28     /**
29      * Private constructor to prevent initialisation
30      */
UCharacterDirection()31     private UCharacterDirection()
32     {
33     }
34     ///CLOVER:ON
35 
36     /**
37      * Gets the name of the argument direction
38      * @param dir direction type to retrieve name
39      * @return directional name
40      * @stable ICU 2.1
41      */
toString(int dir)42     public static String toString(int dir) {
43         switch(dir)
44             {
45             case LEFT_TO_RIGHT :
46                 return "Left-to-Right";
47             case RIGHT_TO_LEFT :
48                 return "Right-to-Left";
49             case EUROPEAN_NUMBER :
50                 return "European Number";
51             case EUROPEAN_NUMBER_SEPARATOR :
52                 return "European Number Separator";
53             case EUROPEAN_NUMBER_TERMINATOR :
54                 return "European Number Terminator";
55             case ARABIC_NUMBER :
56                 return "Arabic Number";
57             case COMMON_NUMBER_SEPARATOR :
58                 return "Common Number Separator";
59             case BLOCK_SEPARATOR :
60                 return "Paragraph Separator";
61             case SEGMENT_SEPARATOR :
62                 return "Segment Separator";
63             case WHITE_SPACE_NEUTRAL :
64                 return "Whitespace";
65             case OTHER_NEUTRAL :
66                 return "Other Neutrals";
67             case LEFT_TO_RIGHT_EMBEDDING :
68                 return "Left-to-Right Embedding";
69             case LEFT_TO_RIGHT_OVERRIDE :
70                 return "Left-to-Right Override";
71             case RIGHT_TO_LEFT_ARABIC :
72                 return "Right-to-Left Arabic";
73             case RIGHT_TO_LEFT_EMBEDDING :
74                 return "Right-to-Left Embedding";
75             case RIGHT_TO_LEFT_OVERRIDE :
76                 return "Right-to-Left Override";
77             case POP_DIRECTIONAL_FORMAT :
78                 return "Pop Directional Format";
79             case DIR_NON_SPACING_MARK :
80                 return "Non-Spacing Mark";
81             case BOUNDARY_NEUTRAL :
82                 return "Boundary Neutral";
83             case FIRST_STRONG_ISOLATE:
84                 return "First Strong Isolate";
85             case LEFT_TO_RIGHT_ISOLATE:
86                 return "Left-to-Right Isolate";
87             case RIGHT_TO_LEFT_ISOLATE:
88                 return "Right-to-Left Isolate";
89             case POP_DIRECTIONAL_ISOLATE:
90                 return "Pop Directional Isolate";
91             }
92         return "Unassigned";
93     }
94 }
95