Package com.ibm.icu.charset
Class UConverterAlias
- java.lang.Object
-
- com.ibm.icu.charset.UConverterAlias
-
final class UConverterAlias extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static int
aliasListIndex
(package private) static int
AMBIGUOUS_ALIAS_MAP_BIT
(package private) static byte[]
asciiTypes
private static java.lang.String
CNVALIAS_DATA_FILE_NAME
(package private) static int
CONTAINS_OPTION_BIT
(package private) static int
CONVERTER_INDEX_MASK
private static int
converterListIndex
(package private) static java.nio.ByteBuffer
gAliasData
(package private) static char[]
gAliasList
(package private) static int
gAvailableConverterCount
(package private) static java.lang.String[]
gAvailableConverters
(package private) static char[]
gConverterList
(package private) static java.lang.String
gDefaultConverterName
(package private) static byte[]
gNormalizedStringTable
(package private) static char[]
gOptionTable
(package private) static byte[]
gStringTable
(package private) static char[]
gTaggedAliasArray
(package private) static char[]
gTaggedAliasLists
(package private) static char[]
gTagList
(package private) static char[]
gUntaggedConvArray
private static byte
IGNORE
(package private) static byte
MINLETTER
private static int
minTocLength
private static byte
NONZERO
private static int
normalizedStringTableIndex
(package private) static int
NUM_HIDDEN_TAGS
(package private) static int
NUM_RESERVED_TAGS
private static int
offsetsCount
private static int
optionTableIndex
(package private) static int
STD_NORMALIZED
private static int
stringTableIndex
private static int
taggedAliasArrayIndex
private static int
taggedAliasListsIndex
private static int
tagListIndex
(package private) static int
tocLengthIndex
(package private) static int
UNNORMALIZED
private static int
untaggedConvArrayIndex
private static byte
ZERO
-
Constructor Summary
Constructors Constructor Description UConverterAlias()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static int
bld_countAvailableConverters()
(package private) static java.lang.String
bld_getAvailableConverter(int n)
(package private) static int
compareNames(java.lang.String name1, java.lang.String name2)
Do a fuzzy compare of a two converter/alias names.(package private) static int
countAliases(java.lang.String alias)
(package private) static int
countAvailable()
private static java.lang.String
extractString(byte[] sArray, int sBegin)
private static int
findConverter(java.lang.String alias, boolean[] isAmbigous)
private static int
findTaggedAliasListsOffset(java.lang.String alias, java.lang.String standard)
private static int
findTaggedConverterNum(java.lang.String alias, java.lang.String standard)
private static char
GET_CHAR_TYPE(char c)
private static java.lang.String
GET_NORMALIZED_STRING(int idx)
private static java.lang.String
GET_STRING(int idx)
(package private) static java.lang.String
getAlias(java.lang.String alias, int n)
(package private) static java.lang.String
getAvailableName(int n)
(package private) static java.lang.String
getCanonicalName(java.lang.String alias, java.lang.String standard)
(package private) static java.lang.String
getStandardName(java.lang.String alias, java.lang.String standard)
private static int
getTagNumber(java.lang.String tagName)
private static boolean
haveAliasData()
(package private) static boolean
haveAvailableConverterList()
(package private) static int
io_countAliases(java.lang.String alias)
(package private) static java.lang.String
io_getAlias(java.lang.String alias, int n)
Return the number of all aliases (and converter names).private static java.lang.StringBuilder
io_stripASCIIForCompare(java.lang.StringBuilder dst, java.lang.String name)
private static boolean
isAlias(java.lang.String alias)
private static boolean
isAliasInList(java.lang.String alias, int listOffset)
static java.lang.StringBuilder
stripForCompare(java.lang.StringBuilder dst, java.lang.String name)
stripForCompare Remove the underscores, dashes and spaces from the name, and convert the name to lower case.private static int
strlen(byte[] sArray, int sBegin)
-
-
-
Field Detail
-
UNNORMALIZED
static final int UNNORMALIZED
- See Also:
- Constant Field Values
-
STD_NORMALIZED
static final int STD_NORMALIZED
- See Also:
- Constant Field Values
-
AMBIGUOUS_ALIAS_MAP_BIT
static final int AMBIGUOUS_ALIAS_MAP_BIT
- See Also:
- Constant Field Values
-
CONTAINS_OPTION_BIT
static final int CONTAINS_OPTION_BIT
- See Also:
- Constant Field Values
-
CONVERTER_INDEX_MASK
static final int CONVERTER_INDEX_MASK
- See Also:
- Constant Field Values
-
NUM_RESERVED_TAGS
static final int NUM_RESERVED_TAGS
- See Also:
- Constant Field Values
-
NUM_HIDDEN_TAGS
static final int NUM_HIDDEN_TAGS
- See Also:
- Constant Field Values
-
gConverterList
static char[] gConverterList
-
gTagList
static char[] gTagList
-
gAliasList
static char[] gAliasList
-
gUntaggedConvArray
static char[] gUntaggedConvArray
-
gTaggedAliasArray
static char[] gTaggedAliasArray
-
gTaggedAliasLists
static char[] gTaggedAliasLists
-
gOptionTable
static char[] gOptionTable
-
gStringTable
static byte[] gStringTable
-
gNormalizedStringTable
static byte[] gNormalizedStringTable
-
tocLengthIndex
static final int tocLengthIndex
- See Also:
- Constant Field Values
-
converterListIndex
private static final int converterListIndex
- See Also:
- Constant Field Values
-
tagListIndex
private static final int tagListIndex
- See Also:
- Constant Field Values
-
aliasListIndex
private static final int aliasListIndex
- See Also:
- Constant Field Values
-
untaggedConvArrayIndex
private static final int untaggedConvArrayIndex
- See Also:
- Constant Field Values
-
taggedAliasArrayIndex
private static final int taggedAliasArrayIndex
- See Also:
- Constant Field Values
-
taggedAliasListsIndex
private static final int taggedAliasListsIndex
- See Also:
- Constant Field Values
-
optionTableIndex
private static final int optionTableIndex
- See Also:
- Constant Field Values
-
stringTableIndex
private static final int stringTableIndex
- See Also:
- Constant Field Values
-
normalizedStringTableIndex
private static final int normalizedStringTableIndex
- See Also:
- Constant Field Values
-
minTocLength
private static final int minTocLength
- See Also:
- Constant Field Values
-
offsetsCount
private static final int offsetsCount
- See Also:
- Constant Field Values
-
gAliasData
static java.nio.ByteBuffer gAliasData
-
CNVALIAS_DATA_FILE_NAME
private static final java.lang.String CNVALIAS_DATA_FILE_NAME
- See Also:
- Constant Field Values
-
IGNORE
private static final byte IGNORE
- See Also:
- Constant Field Values
-
ZERO
private static final byte ZERO
- See Also:
- Constant Field Values
-
NONZERO
private static final byte NONZERO
- See Also:
- Constant Field Values
-
MINLETTER
static final byte MINLETTER
- See Also:
- Constant Field Values
-
asciiTypes
static final byte[] asciiTypes
-
gAvailableConverters
static java.lang.String[] gAvailableConverters
-
gAvailableConverterCount
static int gAvailableConverterCount
-
gDefaultConverterName
static java.lang.String gDefaultConverterName
-
-
Method Detail
-
GET_STRING
private static final java.lang.String GET_STRING(int idx)
-
GET_NORMALIZED_STRING
private static final java.lang.String GET_NORMALIZED_STRING(int idx)
-
extractString
private static final java.lang.String extractString(byte[] sArray, int sBegin)
-
strlen
private static final int strlen(byte[] sArray, int sBegin)
-
isAlias
private static final boolean isAlias(java.lang.String alias)
-
haveAliasData
private static final boolean haveAliasData() throws java.io.IOException
- Throws:
java.io.IOException
-
findConverter
private static final int findConverter(java.lang.String alias, boolean[] isAmbigous)
-
stripForCompare
public static final java.lang.StringBuilder stripForCompare(java.lang.StringBuilder dst, java.lang.String name)
stripForCompare Remove the underscores, dashes and spaces from the name, and convert the name to lower case.- Parameters:
dst
- The destination buffer, which is <= the buffer of name.name
- The alias to strip- Returns:
- the destination buffer.
-
GET_CHAR_TYPE
private static final char GET_CHAR_TYPE(char c)
-
io_stripASCIIForCompare
private static final java.lang.StringBuilder io_stripASCIIForCompare(java.lang.StringBuilder dst, java.lang.String name)
-
compareNames
static int compareNames(java.lang.String name1, java.lang.String name2)
Do a fuzzy compare of a two converter/alias names. The comparison is case-insensitive. It also ignores the characters '-', '_', and ' ' (dash, underscore, and space). Thus the strings "UTF-8", "utf_8", and "Utf 8" are exactly equivalent. This is a symmetrical (commutative) operation; order of arguments is insignificant. This is an important property for sorting the list (when the list is preprocessed into binary form) and for performing binary searches on it at run time.- Parameters:
name1
- a converter name or alias, zero-terminatedname2
- a converter name or alias, zero-terminated- Returns:
- 0 if the names match, or a negative value if the name1 lexically precedes name2, or a positive value if the name1 lexically follows name2.
- See Also:
stripForCompare(java.lang.StringBuilder, java.lang.String)
-
io_countAliases
static int io_countAliases(java.lang.String alias) throws java.io.IOException
- Throws:
java.io.IOException
-
io_getAlias
static java.lang.String io_getAlias(java.lang.String alias, int n) throws java.io.IOException
Return the number of all aliases (and converter names).- Returns:
- the number of all aliases
- Throws:
java.io.IOException
-
getStandardName
static final java.lang.String getStandardName(java.lang.String alias, java.lang.String standard) throws java.io.IOException
- Throws:
java.io.IOException
-
countAliases
static int countAliases(java.lang.String alias) throws java.io.IOException
- Throws:
java.io.IOException
-
getAlias
static java.lang.String getAlias(java.lang.String alias, int n) throws java.io.IOException
- Throws:
java.io.IOException
-
getAvailableName
static java.lang.String getAvailableName(int n)
-
getCanonicalName
static java.lang.String getCanonicalName(java.lang.String alias, java.lang.String standard) throws java.io.IOException
- Throws:
java.io.IOException
-
countAvailable
static int countAvailable()
-
getTagNumber
private static int getTagNumber(java.lang.String tagName)
-
findTaggedAliasListsOffset
private static int findTaggedAliasListsOffset(java.lang.String alias, java.lang.String standard)
-
findTaggedConverterNum
private static int findTaggedConverterNum(java.lang.String alias, java.lang.String standard)
-
isAliasInList
private static boolean isAliasInList(java.lang.String alias, int listOffset)
-
haveAvailableConverterList
static boolean haveAvailableConverterList() throws java.io.IOException
- Throws:
java.io.IOException
-
bld_countAvailableConverters
static int bld_countAvailableConverters() throws java.io.IOException
- Throws:
java.io.IOException
-
bld_getAvailableConverter
static java.lang.String bld_getAvailableConverter(int n) throws java.io.IOException
- Throws:
java.io.IOException
-
-