Path: blob/master/src/java.base/share/classes/jdk/internal/icu/lang/UCharacterDirection.java
41161 views
/*1* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.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 it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* 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 WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 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 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/24/*25/**26*******************************************************************************27* Copyright (C) 1996-2004, International Business Machines Corporation and *28* others. All Rights Reserved. *29*******************************************************************************30*/31// CHANGELOG32// 2005-05-19 Edward Wang33// - copy this file from icu4jsrc_3_2/src/com/ibm/icu/lang/UCharacterDirection.java34// - move from package com.ibm.icu.lang to package sun.net.idn35//3637package jdk.internal.icu.lang;3839/**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 subclassable44* </p>45* @author Syn Wee Quek46* @stable ICU 2.147*/4849@SuppressWarnings("deprecation")50public final class UCharacterDirection implements UCharacterEnums.ECharacterDirection {5152// private constructor =========================================53///CLOVER:OFF54/**55* Private constructor to prevent initialisation56*/57private UCharacterDirection()58{59}60///CLOVER:ON6162/**63* Gets the name of the argument direction64* @param dir direction type to retrieve name65* @return directional name66* @stable ICU 2.167*/68public static String toString(int dir) {69switch(dir)70{71case LEFT_TO_RIGHT :72return "Left-to-Right";73case RIGHT_TO_LEFT :74return "Right-to-Left";75case EUROPEAN_NUMBER :76return "European Number";77case EUROPEAN_NUMBER_SEPARATOR :78return "European Number Separator";79case EUROPEAN_NUMBER_TERMINATOR :80return "European Number Terminator";81case ARABIC_NUMBER :82return "Arabic Number";83case COMMON_NUMBER_SEPARATOR :84return "Common Number Separator";85case BLOCK_SEPARATOR :86return "Paragraph Separator";87case SEGMENT_SEPARATOR :88return "Segment Separator";89case WHITE_SPACE_NEUTRAL :90return "Whitespace";91case OTHER_NEUTRAL :92return "Other Neutrals";93case LEFT_TO_RIGHT_EMBEDDING :94return "Left-to-Right Embedding";95case LEFT_TO_RIGHT_OVERRIDE :96return "Left-to-Right Override";97case RIGHT_TO_LEFT_ARABIC :98return "Right-to-Left Arabic";99case RIGHT_TO_LEFT_EMBEDDING :100return "Right-to-Left Embedding";101case RIGHT_TO_LEFT_OVERRIDE :102return "Right-to-Left Override";103case POP_DIRECTIONAL_FORMAT :104return "Pop Directional Format";105case DIR_NON_SPACING_MARK :106return "Non-Spacing Mark";107case BOUNDARY_NEUTRAL :108return "Boundary Neutral";109}110return "Unassigned";111}112}113114115