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 @SuppressWarnings("deprecation") 50 final class UCharacterDirection implements UCharacterEnums.ECharacterDirection { 51 52 // private constructor ========================================= 53 ///CLOVER:OFF 54 /** 55 * Private constructor to prevent initialisation 56 */ 57 private UCharacterDirection() 58 { 59 } 60 ///CLOVER:ON 61 62 /** 63 * Gets the name of the argument direction 64 * @param dir direction type to retrieve name 65 * @return directional name 66 * @stable ICU 2.1 67 */ 68 public static String toString(int dir) { 69 switch(dir) 70 { 71 case LEFT_TO_RIGHT : 72 return "Left-to-Right"; 73 case RIGHT_TO_LEFT : 74 return "Right-to-Left"; 75 case EUROPEAN_NUMBER : 76 return "European Number"; 77 case EUROPEAN_NUMBER_SEPARATOR : 78 return "European Number Separator"; 79 case EUROPEAN_NUMBER_TERMINATOR : 80 return "European Number Terminator"; 81 case ARABIC_NUMBER : 82 return "Arabic Number"; 83 case COMMON_NUMBER_SEPARATOR : 84 return "Common Number Separator"; 85 case BLOCK_SEPARATOR : 86 return "Paragraph Separator"; 87 case SEGMENT_SEPARATOR : 88 return "Segment Separator"; 89 case WHITE_SPACE_NEUTRAL : 90 return "Whitespace"; 91 case OTHER_NEUTRAL : 92 return "Other Neutrals"; 93 case LEFT_TO_RIGHT_EMBEDDING : 94 return "Left-to-Right Embedding"; 95 case LEFT_TO_RIGHT_OVERRIDE : 96 return "Left-to-Right Override"; 97 case RIGHT_TO_LEFT_ARABIC : 98 return "Right-to-Left Arabic"; 99 case RIGHT_TO_LEFT_EMBEDDING : 100 return "Right-to-Left Embedding"; 101 case RIGHT_TO_LEFT_OVERRIDE : 102 return "Right-to-Left Override"; 103 case POP_DIRECTIONAL_FORMAT : 104 return "Pop Directional Format"; 105 case DIR_NON_SPACING_MARK : 106 return "Non-Spacing Mark"; 107 case BOUNDARY_NEUTRAL : 108 return "Boundary Neutral"; 109 } 110 return "Unassigned"; 111 } 112 }