Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/sun/net/idn/UCharacterDirection.java
38918 views
/*1* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation. Oracle designates this6* particular file as subject to the "Classpath" exception as provided7* by Oracle in the LICENSE file that accompanied this code.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*/23/*24/**25*******************************************************************************26* Copyright (C) 1996-2004, International Business Machines Corporation and *27* others. All Rights Reserved. *28*******************************************************************************29*/30// CHANGELOG31// 2005-05-19 Edward Wang32// - copy this file from icu4jsrc_3_2/src/com/ibm/icu/lang/UCharacterDirection.java33// - move from package com.ibm.icu.lang to package sun.net.idn34//3536package sun.net.idn;3738/**39* Enumerated Unicode character linguistic direction constants.40* Used as return results from <a href=UCharacter.html>UCharacter</a>41* <p>42* This class is not subclassable43* </p>44* @author Syn Wee Quek45* @stable ICU 2.146*/4748final class UCharacterDirection implements UCharacterEnums.ECharacterDirection {4950// private constructor =========================================51///CLOVER:OFF52/**53* Private constructor to prevent initialisation54*/55private UCharacterDirection()56{57}58///CLOVER:ON5960/**61* Gets the name of the argument direction62* @param dir direction type to retrieve name63* @return directional name64* @stable ICU 2.165*/66public static String toString(int dir) {67switch(dir)68{69case LEFT_TO_RIGHT :70return "Left-to-Right";71case RIGHT_TO_LEFT :72return "Right-to-Left";73case EUROPEAN_NUMBER :74return "European Number";75case EUROPEAN_NUMBER_SEPARATOR :76return "European Number Separator";77case EUROPEAN_NUMBER_TERMINATOR :78return "European Number Terminator";79case ARABIC_NUMBER :80return "Arabic Number";81case COMMON_NUMBER_SEPARATOR :82return "Common Number Separator";83case BLOCK_SEPARATOR :84return "Paragraph Separator";85case SEGMENT_SEPARATOR :86return "Segment Separator";87case WHITE_SPACE_NEUTRAL :88return "Whitespace";89case OTHER_NEUTRAL :90return "Other Neutrals";91case LEFT_TO_RIGHT_EMBEDDING :92return "Left-to-Right Embedding";93case LEFT_TO_RIGHT_OVERRIDE :94return "Left-to-Right Override";95case RIGHT_TO_LEFT_ARABIC :96return "Right-to-Left Arabic";97case RIGHT_TO_LEFT_EMBEDDING :98return "Right-to-Left Embedding";99case RIGHT_TO_LEFT_OVERRIDE :100return "Right-to-Left Override";101case POP_DIRECTIONAL_FORMAT :102return "Pop Directional Format";103case DIR_NON_SPACING_MARK :104return "Non-Spacing Mark";105case BOUNDARY_NEUTRAL :106return "Boundary Neutral";107}108return "Unassigned";109}110}111112113