1 /*
   2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   3  *
   4  * This code is free software; you can redistribute it and/or modify it
   5  * under the terms of the GNU General Public License version 2 only, as
   6  * published by the Free Software Foundation.  Oracle designates this
   7  * particular file as subject to the "Classpath" exception as provided
   8  * by Oracle in the LICENSE file that accompanied this code.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  */
  24 /*
  25 /**
  26 *******************************************************************************
  27 * Copyright (C) 1996-2004, International Business Machines Corporation and    *
  28 * others. All Rights Reserved.                                                *
  29 *******************************************************************************
  30 */
  31 // CHANGELOG
  32 //      2005-05-19 Edward Wang
  33 //          - copy this file from icu4jsrc_3_2/src/com/ibm/icu/lang/UCharacterDirection.java
  34 //          - move from package com.ibm.icu.lang to package sun.net.idn
  35 //
  36 
  37 package sun.net.idn;
  38 
  39 /**
  40  * Enumerated Unicode character linguistic direction constants.
  41  * Used as return results from <a href=UCharacter.html>UCharacter</a>
  42  * <p>
  43  * This class is not subclassable
  44  * </p>
  45  * @author Syn Wee Quek
  46  * @stable ICU 2.1
  47  */
  48 
  49 final class UCharacterDirection implements UCharacterEnums.ECharacterDirection {
  50 
  51     // private constructor =========================================
  52     ///CLOVER:OFF
  53     /**
  54      * Private constructor to prevent initialisation
  55      */
  56     private UCharacterDirection()
  57     {
  58     }
  59     ///CLOVER:ON
  60 
  61     /**
  62      * Gets the name of the argument direction
  63      * @param dir direction type to retrieve name
  64      * @return directional name
  65      * @stable ICU 2.1
  66      */
  67     public static String toString(int dir) {
  68         switch(dir)
  69             {
  70             case LEFT_TO_RIGHT :
  71                 return "Left-to-Right";
  72             case RIGHT_TO_LEFT :
  73                 return "Right-to-Left";
  74             case EUROPEAN_NUMBER :
  75                 return "European Number";
  76             case EUROPEAN_NUMBER_SEPARATOR :
  77                 return "European Number Separator";
  78             case EUROPEAN_NUMBER_TERMINATOR :
  79                 return "European Number Terminator";
  80             case ARABIC_NUMBER :
  81                 return "Arabic Number";
  82             case COMMON_NUMBER_SEPARATOR :
  83                 return "Common Number Separator";
  84             case BLOCK_SEPARATOR :
  85                 return "Paragraph Separator";
  86             case SEGMENT_SEPARATOR :
  87                 return "Segment Separator";
  88             case WHITE_SPACE_NEUTRAL :
  89                 return "Whitespace";
  90             case OTHER_NEUTRAL :
  91                 return "Other Neutrals";
  92             case LEFT_TO_RIGHT_EMBEDDING :
  93                 return "Left-to-Right Embedding";
  94             case LEFT_TO_RIGHT_OVERRIDE :
  95                 return "Left-to-Right Override";
  96             case RIGHT_TO_LEFT_ARABIC :
  97                 return "Right-to-Left Arabic";
  98             case RIGHT_TO_LEFT_EMBEDDING :
  99                 return "Right-to-Left Embedding";
 100             case RIGHT_TO_LEFT_OVERRIDE :
 101                 return "Right-to-Left Override";
 102             case POP_DIRECTIONAL_FORMAT :
 103                 return "Pop Directional Format";
 104             case DIR_NON_SPACING_MARK :
 105                 return "Non-Spacing Mark";
 106             case BOUNDARY_NEUTRAL :
 107                 return "Boundary Neutral";
 108             }
 109         return "Unassigned";
 110     }
 111 }