Update #47 - Singleplayer lag fixes

This commit is contained in:
lax1dude
2025-01-19 13:26:27 -08:00
parent 3f5ee57068
commit 1f0d593a8c
2052 changed files with 133581 additions and 2339 deletions

View File

@ -0,0 +1,562 @@
/*
* Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
*******************************************************************************
* Copyright (C) 1996-2014, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*/
package jdk_internal.bidi.icu.lang;
import jdk_internal.bidi.icu.impl.UBiDiProps;
import jdk_internal.bidi.icu.impl.UCharacterProperty;
import jdk_internal.bidi.icu.text.Normalizer2;
import jdk_internal.bidi.icu.text.UTF16;
import jdk_internal.bidi.icu.util.VersionInfo;
/**
* <p>
* The UCharacter class provides extensions to the
* <a href="http://java.sun.com/j2se/1.5/docs/api/java/lang/Character.html">
* java.lang.Character</a> class. These extensions provide support for more
* Unicode properties and together with the <a href=../text/UTF16.html>UTF16</a>
* class, provide support for supplementary characters (those with code points
* above U+FFFF). Each ICU release supports the latest version of Unicode
* available at that time.
*
* <p>
* Code points are represented in these API using ints. While it would be more
* convenient in Java to have a separate primitive datatype for them, ints
* suffice in the meantime.
*
* <p>
* To use this class please add the jar file name icu4j.jar to the class path,
* since it contains data files which supply the information used by this
* file.<br>
* E.g. In Windows <br>
* <code>set CLASSPATH=%CLASSPATH%;$JAR_FILE_PATH/ucharacter.jar</code>.<br>
* Otherwise, another method would be to copy the files uprops.dat and
* unames.icu from the icu4j source subdirectory
* <i>$ICU4J_SRC/src/com.ibm.icu.impl.data</i> to your class directory
* <i>$ICU4J_CLASS/com.ibm.icu.impl.data</i>.
*
* <p>
* Aside from the additions for UTF-16 support, and the updated Unicode
* properties, the main differences between UCharacter and Character are:
* <ul>
* <li>UCharacter is not designed to be a char wrapper and does not have APIs to
* which involves management of that single char.<br>
* These include:
* <ul>
* <li>char charValue(),
* <li>int compareTo(java.lang.Character, java.lang.Character), etc.
* </ul>
* <li>UCharacter does not include Character APIs that are deprecated, nor does
* it include the Java-specific character information, such as boolean
* isJavaIdentifierPart(char ch).
* <li>Character maps characters 'A' - 'Z' and 'a' - 'z' to the numeric values
* '10' - '35'. UCharacter also does this in digit and getNumericValue, to
* adhere to the java semantics of these methods. New methods unicodeDigit, and
* getUnicodeNumericValue do not treat the above code points as having numeric
* values. This is a semantic change from ICU4J 1.3.1.
* </ul>
* <p>
* Further detail on differences can be determined using the program <a href=
* "http://source.icu-project.org/repos/icu/icu4j/trunk/src/com/ibm/icu/dev/test/lang/UCharacterCompare.java">
* com.ibm.icu.dev.test.lang.UCharacterCompare</a>
* </p>
* <p>
* In addition to Java compatibility functions, which calculate derived
* properties, this API provides low-level access to the Unicode Character
* Database.
* </p>
* <p>
* Unicode assigns each code point (not just assigned character) values for many
* properties. Most of them are simple boolean flags, or constants from a small
* enumerated list. For some properties, values are strings or other relatively
* more complex types.
* </p>
* <p>
* For more information see <a href="http://www.unicode/org/ucd/">"About the
* Unicode Character Database"</a> (http://www.unicode.org/ucd/) and the
* <a href="http://www.icu-project.org/userguide/properties.html">ICU User Guide
* chapter on Properties</a>
* (http://www.icu-project.org/userguide/properties.html).
* </p>
* <p>
* There are also functions that provide easy migration from C/POSIX functions
* like isblank(). Their use is generally discouraged because the C/POSIX
* standards do not define their semantics beyond the ASCII range, which means
* that different implementations exhibit very different behavior. Instead,
* Unicode properties should be used directly.
* </p>
* <p>
* There are also only a few, broad C/POSIX character classes, and they tend to
* be used for conflicting purposes. For example, the "isalpha()" class is
* sometimes used to determine word boundaries, while a more sophisticated
* approach would at least distinguish initial letters from continuation
* characters (the latter including combining marks). (In ICU, BreakIterator is
* the most sophisticated API for word boundaries.) Another example: There is no
* "istitle()" class for titlecase characters.
* </p>
* <p>
* ICU 3.4 and later provides API access for all twelve C/POSIX character
* classes. ICU implements them according to the Standard Recommendations in
* Annex C: Compatibility Properties of UTS #18 Unicode Regular Expressions
* (http://www.unicode.org/reports/tr18/#Compatibility_Properties).
* </p>
* <p>
* API access for C/POSIX character classes is as follows:
*
* <pre>{@code
* - alpha: isUAlphabetic(c) or hasBinaryProperty(c, UProperty.ALPHABETIC)
* - lower: isULowercase(c) or hasBinaryProperty(c, UProperty.LOWERCASE)
* - upper: isUUppercase(c) or hasBinaryProperty(c, UProperty.UPPERCASE)
* - punct: ((1<<getType(c)) & ((1<<DASH_PUNCTUATION)|(1<<START_PUNCTUATION)|
* (1<<END_PUNCTUATION)|(1<<CONNECTOR_PUNCTUATION)|(1<<OTHER_PUNCTUATION)|
* (1<<INITIAL_PUNCTUATION)|(1<<FINAL_PUNCTUATION)))!=0
* - digit: isDigit(c) or getType(c)==DECIMAL_DIGIT_NUMBER
* - xdigit: hasBinaryProperty(c, UProperty.POSIX_XDIGIT)
* - alnum: hasBinaryProperty(c, UProperty.POSIX_ALNUM)
* - space: isUWhiteSpace(c) or hasBinaryProperty(c, UProperty.WHITE_SPACE)
* - blank: hasBinaryProperty(c, UProperty.POSIX_BLANK)
* - cntrl: getType(c)==CONTROL
* - graph: hasBinaryProperty(c, UProperty.POSIX_GRAPH)
* - print: hasBinaryProperty(c, UProperty.POSIX_PRINT)
* }</pre>
* </p>
* <p>
* The C/POSIX character classes are also available in UnicodeSet patterns,
* using patterns like [:graph:] or \p{graph}.
* </p>
*
* There are several ICU (and Java) whitespace functions. Comparison:
* <ul>
* <li>isUWhiteSpace=UCHAR_WHITE_SPACE: Unicode White_Space property; most of
* general categories "Z" (separators) + most whitespace ISO controls (including
* no-break spaces, but excluding IS1..IS4 and ZWSP)
* <li>isWhitespace: Java isWhitespace; Z + whitespace ISO controls but
* excluding no-break spaces
* <li>isSpaceChar: just Z (including no-break spaces)
* </ul>
* </p>
* <p>
* This class is not subclassable.
* </p>
*
* @author Syn Wee Quek
* @stable ICU 2.1
* @see com.ibm.icu.lang.UCharacterEnums
*/
public final class UCharacter {
/**
* Joining Group constants.
*
* @see UProperty#JOINING_GROUP
* @stable ICU 2.4
*/
public static interface JoiningGroup {
/**
* @stable ICU 2.4
*/
public static final int NO_JOINING_GROUP = 0;
}
/**
* Numeric Type constants.
*
* @see UProperty#NUMERIC_TYPE
* @stable ICU 2.4
*/
public static interface NumericType {
/**
* @stable ICU 2.4
*/
public static final int NONE = 0;
/**
* @stable ICU 2.4
*/
public static final int DECIMAL = 1;
/**
* @stable ICU 2.4
*/
public static final int DIGIT = 2;
/**
* @stable ICU 2.4
*/
public static final int NUMERIC = 3;
/**
* @stable ICU 2.4
*/
public static final int COUNT = 4;
}
/**
* Hangul Syllable Type constants.
*
* @see UProperty#HANGUL_SYLLABLE_TYPE
* @stable ICU 2.6
*/
public static interface HangulSyllableType {
/**
* @stable ICU 2.6
*/
public static final int NOT_APPLICABLE = 0; /* [NA] */ /* See note !! */
/**
* @stable ICU 2.6
*/
public static final int LEADING_JAMO = 1; /* [L] */
/**
* @stable ICU 2.6
*/
public static final int VOWEL_JAMO = 2; /* [V] */
/**
* @stable ICU 2.6
*/
public static final int TRAILING_JAMO = 3; /* [T] */
/**
* @stable ICU 2.6
*/
public static final int LV_SYLLABLE = 4; /* [LV] */
/**
* @stable ICU 2.6
*/
public static final int LVT_SYLLABLE = 5; /* [LVT] */
/**
* @stable ICU 2.6
*/
public static final int COUNT = 6;
}
// public data members -----------------------------------------------
/**
* The lowest Unicode code point value.
*
* @stable ICU 2.1
*/
public static final int MIN_VALUE = UTF16.CODEPOINT_MIN_VALUE;
/**
* The highest Unicode code point value (scalar value) according to the Unicode
* Standard. This is a 21-bit value (21 bits, rounded up).<br>
* Up-to-date Unicode implementation of java.lang.Character.MAX_VALUE
*
* @stable ICU 2.1
*/
public static final int MAX_VALUE = UTF16.CODEPOINT_MAX_VALUE;
// public methods ----------------------------------------------------
/**
* Returns the numeric value of a decimal digit code point. <br>
* This method observes the semantics of
* <code>java.lang.Character.digit()</code>. Note that this will return positive
* values for code points for which isDigit returns false, just like
* java.lang.Character. <br>
* <em>Semantic Change:</em> In release 1.3.1 and prior, this did not treat the
* European letters as having a digit value, and also treated numeric letters
* and other numbers as digits. This has been changed to conform to the java
* semantics. <br>
* A code point is a valid digit if and only if:
* <ul>
* <li>ch is a decimal digit or one of the european letters, and
* <li>the value of ch is less than the specified radix.
* </ul>
*
* @param ch the code point to query
* @param radix the radix
* @return the numeric value represented by the code point in the specified
* radix, or -1 if the code point is not a decimal digit or if its value
* is too large for the radix
* @stable ICU 2.1
*/
public static int digit(int ch, int radix) {
if (2 <= radix && radix <= 36) {
int value = digit(ch);
if (value < 0) {
// ch is not a decimal digit, try latin letters
value = UCharacterProperty.getEuropeanDigit(ch);
}
return (value < radix) ? value : -1;
} else {
return -1; // invalid radix
}
}
/**
* Returns the numeric value of a decimal digit code point. <br>
* This is a convenience overload of <code>digit(int, int)</code> that provides
* a decimal radix. <br>
* <em>Semantic Change:</em> In release 1.3.1 and prior, this treated numeric
* letters and other numbers as digits. This has been changed to conform to the
* java semantics.
*
* @param ch the code point to query
* @return the numeric value represented by the code point, or -1 if the code
* point is not a decimal digit or if its value is too large for a
* decimal radix
* @stable ICU 2.1
*/
public static int digit(int ch) {
return UCharacterProperty.INSTANCE.digit(ch);
}
/**
* Returns a value indicating a code point's Unicode category. Up-to-date
* Unicode implementation of java.lang.Character.getType() except for the above
* mentioned code points that had their category changed.<br>
* Return results are constants from the interface
* <a href=UCharacterCategory.html>UCharacterCategory</a><br>
* <em>NOTE:</em> the UCharacterCategory values are <em>not</em> compatible with
* those returned by java.lang.Character.getType. UCharacterCategory values
* match the ones used in ICU4C, while java.lang.Character type values, though
* similar, skip the value 17.
* </p>
*
* @param ch code point whose type is to be determined
* @return category which is a value of UCharacterCategory
* @stable ICU 2.1
*/
public static int getType(int ch) {
return UCharacterProperty.INSTANCE.getType(ch);
}
/**
* Returns the Bidirection property of a code point. For example, 0x0041 (letter
* A) has the LEFT_TO_RIGHT directional property.<br>
* Result returned belongs to the interface
* <a href=UCharacterDirection.html>UCharacterDirection</a>
*
* @param ch the code point to be determined its direction
* @return direction constant from UCharacterDirection.
* @stable ICU 2.1
*/
public static int getDirection(int ch) {
return UBiDiProps.INSTANCE.getClass(ch);
}
/**
* Maps the specified code point to a "mirror-image" code point. For code points
* with the "mirrored" property, implementations sometimes need a "poor man's"
* mapping to another code point such that the default glyph may serve as the
* mirror-image of the default glyph of the specified code point.<br>
* This is useful for text conversion to and from codepages with visual order,
* and for displays without glyph selection capabilities.
*
* @param ch code point whose mirror is to be retrieved
* @return another code point that may serve as a mirror-image substitute, or ch
* itself if there is no such mapping or ch does not have the "mirrored"
* property
* @stable ICU 2.1
*/
public static int getMirror(int ch) {
return UBiDiProps.INSTANCE.getMirror(ch);
}
/**
* Maps the specified character to its paired bracket character. For
* Bidi_Paired_Bracket_Type!=None, this is the same as getMirror(int). Otherwise
* c itself is returned. See http://www.unicode.org/reports/tr9/
*
* @param c the code point to be mapped
* @return the paired bracket code point, or c itself if there is no such
* mapping (Bidi_Paired_Bracket_Type=None)
*
* @see UProperty#BIDI_PAIRED_BRACKET
* @see UProperty#BIDI_PAIRED_BRACKET_TYPE
* @see #getMirror(int)
* @stable ICU 52
*/
public static int getBidiPairedBracket(int c) {
return UBiDiProps.INSTANCE.getPairedBracket(c);
}
/**
* Returns the combining class of the argument codepoint
*
* @param ch code point whose combining is to be retrieved
* @return the combining class of the codepoint
* @stable ICU 2.1
*/
public static int getCombiningClass(int ch) {
return Normalizer2.getNFDInstance().getCombiningClass(ch);
}
/**
* Returns the version of Unicode data used.
*
* @return the unicode version number used
* @stable ICU 2.1
*/
public static VersionInfo getUnicodeVersion() {
return UCharacterProperty.INSTANCE.m_unicodeVersion_;
}
/**
* Returns a code point corresponding to the two UTF16 characters.
*
* @param lead the lead char
* @param trail the trail char
* @return code point if surrogate characters are valid.
* @exception IllegalArgumentException thrown when argument characters do not
* form a valid codepoint
* @stable ICU 2.1
*/
public static int getCodePoint(char lead, char trail) {
if (UTF16.isLeadSurrogate(lead) && UTF16.isTrailSurrogate(trail)) {
return UCharacterProperty.getRawSupplementary(lead, trail);
}
throw new IllegalArgumentException("Illegal surrogate characters");
}
/**
* Returns the "age" of the code point.
* </p>
* <p>
* The "age" is the Unicode version when the code point was first designated (as
* a non-character or for Private Use) or assigned a character.
* <p>
* This can be useful to avoid emitting code points to receiving processes that
* do not accept newer characters.
* </p>
* <p>
* The data is from the UCD file DerivedAge.txt.
* </p>
*
* @param ch The code point.
* @return the Unicode version number
* @stable ICU 2.6
*/
public static VersionInfo getAge(int ch) {
if (ch < MIN_VALUE || ch > MAX_VALUE) {
throw new IllegalArgumentException("Codepoint out of bounds");
}
return UCharacterProperty.INSTANCE.getAge(ch);
}
/**
* Returns the property value for an Unicode property type of a code point. Also
* returns binary and mask property values.
* </p>
* <p>
* Unicode, especially in version 3.2, defines many more properties than the
* original set in UnicodeData.txt.
* </p>
* <p>
* The properties APIs are intended to reflect Unicode properties as defined in
* the Unicode Character Database (UCD) and Unicode Technical Reports (UTR). For
* details about the properties see http://www.unicode.org/.
* </p>
* <p>
* For names of Unicode properties see the UCD file PropertyAliases.txt.
* </p>
*
* <pre>
* Sample usage:
* int ea = UCharacter.getIntPropertyValue(c, UProperty.EAST_ASIAN_WIDTH);
* int ideo = UCharacter.getIntPropertyValue(c, UProperty.IDEOGRAPHIC);
* boolean b = (ideo == 1) ? true : false;
* </pre>
*
* @param ch code point to test.
* @param type UProperty selector constant, identifies which binary property to
* check. Must be UProperty.BINARY_START &lt;= type &lt;
* UProperty.BINARY_LIMIT or UProperty.INT_START &lt;= type &lt;
* UProperty.INT_LIMIT or UProperty.MASK_START &lt;= type &lt;
* UProperty.MASK_LIMIT.
* @return numeric value that is directly the property value or, for enumerated
* properties, corresponds to the numeric value of the enumerated
* constant of the respective property value enumeration type (cast to
* enum type if necessary). Returns 0 or 1 (for false / true) for binary
* Unicode properties. Returns a bit-mask for mask properties. Returns 0
* if 'type' is out of bounds or if the Unicode version does not have
* data for the property at all, or not for this code point.
* @see UProperty
* @see #hasBinaryProperty
* @see #getIntPropertyMinValue
* @see #getIntPropertyMaxValue
* @see #getUnicodeVersion
* @stable ICU 2.4
*/
// for BiDiBase.java
public static int getIntPropertyValue(int ch, int type) {
return UCharacterProperty.INSTANCE.getIntPropertyValue(ch, type);
}
// private constructor -----------------------------------------------
/**
* Private constructor to prevent instantiation
*/
private UCharacter() {
}
/*
* Copied from UCharacterEnums.java
*/
/**
* Character type Mn
*
* @stable ICU 2.1
*/
public static final byte NON_SPACING_MARK = 6;
/**
* Character type Me
*
* @stable ICU 2.1
*/
public static final byte ENCLOSING_MARK = 7;
/**
* Character type Mc
*
* @stable ICU 2.1
*/
public static final byte COMBINING_SPACING_MARK = 8;
/**
* Character type count
*
* @stable ICU 2.1
*/
public static final byte CHAR_CATEGORY_COUNT = 30;
/**
* Directional type R
*
* @stable ICU 2.1
*/
public static final int RIGHT_TO_LEFT = 1;
/**
* Directional type AL
*
* @stable ICU 2.1
*/
public static final int RIGHT_TO_LEFT_ARABIC = 13;
}

View File

@ -0,0 +1,113 @@
/*
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
/**
*******************************************************************************
* Copyright (C) 1996-2004, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
// CHANGELOG
// 2005-05-19 Edward Wang
// - copy this file from icu4jsrc_3_2/src/com/ibm/icu/lang/UCharacterDirection.java
// - move from package com.ibm.icu.lang to package sun.net.idn
//
package jdk_internal.bidi.icu.lang;
/**
* Enumerated Unicode character linguistic direction constants. Used as return
* results from <a href=UCharacter.html>UCharacter</a>
* <p>
* This class is not subclassable
* </p>
*
* @author Syn Wee Quek
* @stable ICU 2.1
*/
@SuppressWarnings("deprecation")
public final class UCharacterDirection implements UCharacterEnums.ECharacterDirection {
// private constructor =========================================
/// CLOVER:OFF
/**
* Private constructor to prevent initialisation
*/
private UCharacterDirection() {
}
/// CLOVER:ON
/**
* Gets the name of the argument direction
*
* @param dir direction type to retrieve name
* @return directional name
* @stable ICU 2.1
*/
public static String toString(int dir) {
switch (dir) {
case LEFT_TO_RIGHT:
return "Left-to-Right";
case RIGHT_TO_LEFT:
return "Right-to-Left";
case EUROPEAN_NUMBER:
return "European Number";
case EUROPEAN_NUMBER_SEPARATOR:
return "European Number Separator";
case EUROPEAN_NUMBER_TERMINATOR:
return "European Number Terminator";
case ARABIC_NUMBER:
return "Arabic Number";
case COMMON_NUMBER_SEPARATOR:
return "Common Number Separator";
case BLOCK_SEPARATOR:
return "Paragraph Separator";
case SEGMENT_SEPARATOR:
return "Segment Separator";
case WHITE_SPACE_NEUTRAL:
return "Whitespace";
case OTHER_NEUTRAL:
return "Other Neutrals";
case LEFT_TO_RIGHT_EMBEDDING:
return "Left-to-Right Embedding";
case LEFT_TO_RIGHT_OVERRIDE:
return "Left-to-Right Override";
case RIGHT_TO_LEFT_ARABIC:
return "Right-to-Left Arabic";
case RIGHT_TO_LEFT_EMBEDDING:
return "Right-to-Left Embedding";
case RIGHT_TO_LEFT_OVERRIDE:
return "Right-to-Left Override";
case POP_DIRECTIONAL_FORMAT:
return "Pop Directional Format";
case DIR_NON_SPACING_MARK:
return "Non-Spacing Mark";
case BOUNDARY_NEUTRAL:
return "Boundary Neutral";
}
return "Unassigned";
}
}

View File

@ -0,0 +1,666 @@
/*
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
/**
*******************************************************************************
* Copyright (C) 2004, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
// CHANGELOG
// 2005-05-19 Edward Wang
// - copy this file from icu4jsrc_3_2/src/com/ibm/icu/lang/UCharacterEnums.java
// - move from package com.ibm.icu.lang to package sun.net.idn
//
// 2011-09-06 Kurchi Subhra Hazra
// - Added @Deprecated tag to the following:
// - class UCharacterEnums
// - interfaces ECharacterCategory, ECharacterDirection
// - fields INITIAL_QUOTE_PUNCTUATION, FINAL_QUOTE_PUNCTUATION,
// DIRECTIONALITY_LEFT_TO_RIGHT, DIRECTIONALITY_RIGHT_TO_LEFT,
// DIRECTIONALITY_EUROPEAN_NUMBER, DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR
// DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR, DIRECTIONALITY_ARABIC_NUMBER,
// DIRECTIONALITY_COMMON_NUMBER_SEPARATOR, DIRECTIONALITY_PARAGRAPH_SEPARATOR,
// DIRECTIONALITY_SEGMENT_SEPARATOR, DIRECTIONALITY_WHITESPACE,
// DIRECTIONALITY_OTHER_NEUTRALS, DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING,
// DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE, DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC,
// DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING, DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE,
// DIRECTIONALITY_POP_DIRECTIONAL_FORMAT, DIRECTIONALITY_NON_SPACING_MARK,
// DIRECTIONALITY_BOUNDARY_NEUTRAL, DIRECTIONALITY_UNDEFINED
//
package jdk_internal.bidi.icu.lang;
/**
* A container for the different 'enumerated types' used by UCharacter.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
class UCharacterEnums {
/** This is just a namespace, it is not instantiatable. */
private UCharacterEnums() {
};
/**
* 'Enum' for the CharacterCategory constants. These constants are compatible in
* name <b>but not in value</b> with those defined in
* <code>java.lang.Character</code>.
*
* @see UCharacterCategory
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static interface ECharacterCategory {
/**
* Unassigned character type
*
* @stable ICU 2.1
*/
public static final int UNASSIGNED = 0;
/**
* Character type Cn Not Assigned (no characters in [UnicodeData.txt] have this
* property)
*
* @stable ICU 2.6
*/
public static final int GENERAL_OTHER_TYPES = 0;
/**
* Character type Lu
*
* @stable ICU 2.1
*/
public static final int UPPERCASE_LETTER = 1;
/**
* Character type Ll
*
* @stable ICU 2.1
*/
public static final int LOWERCASE_LETTER = 2;
/**
* Character type Lt
*
* @stable ICU 2.1
*/
public static final int TITLECASE_LETTER = 3;
/**
* Character type Lm
*
* @stable ICU 2.1
*/
public static final int MODIFIER_LETTER = 4;
/**
* Character type Lo
*
* @stable ICU 2.1
*/
public static final int OTHER_LETTER = 5;
/**
* Character type Mn
*
* @stable ICU 2.1
*/
public static final int NON_SPACING_MARK = 6;
/**
* Character type Me
*
* @stable ICU 2.1
*/
public static final int ENCLOSING_MARK = 7;
/**
* Character type Mc
*
* @stable ICU 2.1
*/
public static final int COMBINING_SPACING_MARK = 8;
/**
* Character type Nd
*
* @stable ICU 2.1
*/
public static final int DECIMAL_DIGIT_NUMBER = 9;
/**
* Character type Nl
*
* @stable ICU 2.1
*/
public static final int LETTER_NUMBER = 10;
/**
* Character type No
*
* @stable ICU 2.1
*/
public static final int OTHER_NUMBER = 11;
/**
* Character type Zs
*
* @stable ICU 2.1
*/
public static final int SPACE_SEPARATOR = 12;
/**
* Character type Zl
*
* @stable ICU 2.1
*/
public static final int LINE_SEPARATOR = 13;
/**
* Character type Zp
*
* @stable ICU 2.1
*/
public static final int PARAGRAPH_SEPARATOR = 14;
/**
* Character type Cc
*
* @stable ICU 2.1
*/
public static final int CONTROL = 15;
/**
* Character type Cf
*
* @stable ICU 2.1
*/
public static final int FORMAT = 16;
/**
* Character type Co
*
* @stable ICU 2.1
*/
public static final int PRIVATE_USE = 17;
/**
* Character type Cs
*
* @stable ICU 2.1
*/
public static final int SURROGATE = 18;
/**
* Character type Pd
*
* @stable ICU 2.1
*/
public static final int DASH_PUNCTUATION = 19;
/**
* Character type Ps
*
* @stable ICU 2.1
*/
public static final int START_PUNCTUATION = 20;
/**
* Character type Pe
*
* @stable ICU 2.1
*/
public static final int END_PUNCTUATION = 21;
/**
* Character type Pc
*
* @stable ICU 2.1
*/
public static final int CONNECTOR_PUNCTUATION = 22;
/**
* Character type Po
*
* @stable ICU 2.1
*/
public static final int OTHER_PUNCTUATION = 23;
/**
* Character type Sm
*
* @stable ICU 2.1
*/
public static final int MATH_SYMBOL = 24;
/**
* Character type Sc
*
* @stable ICU 2.1
*/
public static final int CURRENCY_SYMBOL = 25;
/**
* Character type Sk
*
* @stable ICU 2.1
*/
public static final int MODIFIER_SYMBOL = 26;
/**
* Character type So
*
* @stable ICU 2.1
*/
public static final int OTHER_SYMBOL = 27;
/**
* Character type Pi
*
* @see #INITIAL_QUOTE_PUNCTUATION
* @stable ICU 2.1
*/
public static final int INITIAL_PUNCTUATION = 28;
/**
* Character type Pi This name is compatible with java.lang.Character's name for
* this type.
*
* @see #INITIAL_PUNCTUATION
* @draft ICU 2.8
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final int INITIAL_QUOTE_PUNCTUATION = 28;
/**
* Character type Pf
*
* @see #FINAL_QUOTE_PUNCTUATION
* @stable ICU 2.1
*/
public static final int FINAL_PUNCTUATION = 29;
/**
* Character type Pf This name is compatible with java.lang.Character's name for
* this type.
*
* @see #FINAL_PUNCTUATION
* @draft ICU 2.8
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final int FINAL_QUOTE_PUNCTUATION = 29;
/**
* Character type count
*
* @stable ICU 2.1
*/
public static final int CHAR_CATEGORY_COUNT = 30;
}
/**
* 'Enum' for the CharacterDirection constants. There are two sets of names,
* those used in ICU, and those used in the JDK. The JDK constants are
* compatible in name <b>but not in value</b> with those defined in
* <code>java.lang.Character</code>.
*
* @see UCharacterDirection
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static interface ECharacterDirection {
/**
* Directional type L
*
* @stable ICU 2.1
*/
public static final int LEFT_TO_RIGHT = 0;
/**
* JDK-compatible synonum for LEFT_TO_RIGHT.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_LEFT_TO_RIGHT = (byte) LEFT_TO_RIGHT;
/**
* Directional type R
*
* @stable ICU 2.1
*/
public static final int RIGHT_TO_LEFT = 1;
/**
* JDK-compatible synonum for RIGHT_TO_LEFT.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_RIGHT_TO_LEFT = (byte) RIGHT_TO_LEFT;
/**
* Directional type EN
*
* @stable ICU 2.1
*/
public static final int EUROPEAN_NUMBER = 2;
/**
* JDK-compatible synonum for EUROPEAN_NUMBER.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_EUROPEAN_NUMBER = (byte) EUROPEAN_NUMBER;
/**
* Directional type ES
*
* @stable ICU 2.1
*/
public static final int EUROPEAN_NUMBER_SEPARATOR = 3;
/**
* JDK-compatible synonum for EUROPEAN_NUMBER_SEPARATOR.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR = (byte) EUROPEAN_NUMBER_SEPARATOR;
/**
* Directional type ET
*
* @stable ICU 2.1
*/
public static final int EUROPEAN_NUMBER_TERMINATOR = 4;
/**
* JDK-compatible synonum for EUROPEAN_NUMBER_TERMINATOR.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR = (byte) EUROPEAN_NUMBER_TERMINATOR;
/**
* Directional type AN
*
* @stable ICU 2.1
*/
public static final int ARABIC_NUMBER = 5;
/**
* JDK-compatible synonum for ARABIC_NUMBER.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_ARABIC_NUMBER = (byte) ARABIC_NUMBER;
/**
* Directional type CS
*
* @stable ICU 2.1
*/
public static final int COMMON_NUMBER_SEPARATOR = 6;
/**
* JDK-compatible synonum for COMMON_NUMBER_SEPARATOR.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_COMMON_NUMBER_SEPARATOR = (byte) COMMON_NUMBER_SEPARATOR;
/**
* Directional type B
*
* @stable ICU 2.1
*/
public static final int BLOCK_SEPARATOR = 7;
/**
* JDK-compatible synonum for BLOCK_SEPARATOR.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_PARAGRAPH_SEPARATOR = (byte) BLOCK_SEPARATOR;
/**
* Directional type S
*
* @stable ICU 2.1
*/
public static final int SEGMENT_SEPARATOR = 8;
/**
* JDK-compatible synonum for SEGMENT_SEPARATOR.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_SEGMENT_SEPARATOR = (byte) SEGMENT_SEPARATOR;
/**
* Directional type WS
*
* @stable ICU 2.1
*/
public static final int WHITE_SPACE_NEUTRAL = 9;
/**
* JDK-compatible synonum for WHITE_SPACE_NEUTRAL.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_WHITESPACE = (byte) WHITE_SPACE_NEUTRAL;
/**
* Directional type ON
*
* @stable ICU 2.1
*/
public static final int OTHER_NEUTRAL = 10;
/**
* JDK-compatible synonum for OTHER_NEUTRAL.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_OTHER_NEUTRALS = (byte) OTHER_NEUTRAL;
/**
* Directional type LRE
*
* @stable ICU 2.1
*/
public static final int LEFT_TO_RIGHT_EMBEDDING = 11;
/**
* JDK-compatible synonum for LEFT_TO_RIGHT_EMBEDDING.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING = (byte) LEFT_TO_RIGHT_EMBEDDING;
/**
* Directional type LRO
*
* @stable ICU 2.1
*/
public static final int LEFT_TO_RIGHT_OVERRIDE = 12;
/**
* JDK-compatible synonum for LEFT_TO_RIGHT_OVERRIDE.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE = (byte) LEFT_TO_RIGHT_OVERRIDE;
/**
* Directional type AL
*
* @stable ICU 2.1
*/
public static final int RIGHT_TO_LEFT_ARABIC = 13;
/**
* JDK-compatible synonum for RIGHT_TO_LEFT_ARABIC.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC = (byte) RIGHT_TO_LEFT_ARABIC;
/**
* Directional type RLE
*
* @stable ICU 2.1
*/
public static final int RIGHT_TO_LEFT_EMBEDDING = 14;
/**
* JDK-compatible synonum for RIGHT_TO_LEFT_EMBEDDING.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING = (byte) RIGHT_TO_LEFT_EMBEDDING;
/**
* Directional type RLO
*
* @stable ICU 2.1
*/
public static final int RIGHT_TO_LEFT_OVERRIDE = 15;
/**
* JDK-compatible synonum for RIGHT_TO_LEFT_OVERRIDE.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE = (byte) RIGHT_TO_LEFT_OVERRIDE;
/**
* Directional type PDF
*
* @stable ICU 2.1
*/
public static final int POP_DIRECTIONAL_FORMAT = 16;
/**
* JDK-compatible synonum for POP_DIRECTIONAL_FORMAT.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_POP_DIRECTIONAL_FORMAT = (byte) POP_DIRECTIONAL_FORMAT;
/**
* Directional type NSM
*
* @stable ICU 2.1
*/
public static final int DIR_NON_SPACING_MARK = 17;
/**
* JDK-compatible synonum for DIR_NON_SPACING_MARK.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_NON_SPACING_MARK = (byte) DIR_NON_SPACING_MARK;
/**
* Directional type BN
*
* @stable ICU 2.1
*/
public static final int BOUNDARY_NEUTRAL = 18;
/**
* JDK-compatible synonum for BOUNDARY_NEUTRAL.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_BOUNDARY_NEUTRAL = (byte) BOUNDARY_NEUTRAL;
/**
* Number of directional types
*
* @stable ICU 2.1
*/
public static final int CHAR_DIRECTION_COUNT = 19;
/**
* Undefined bidirectional character type. Undefined <code>char</code> values
* have undefined directionality in the Unicode specification.
*
* @draft ICU 3.0
* @deprecated This is a draft API and might change in a future release of ICU.
*/
@Deprecated
public static final byte DIRECTIONALITY_UNDEFINED = -1;
}
}