Class UConverterAlias


  • final class UConverterAlias
    extends java.lang.Object
    • Field Detail

      • 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
      • untaggedConvArrayIndex

        private static final int untaggedConvArrayIndex
        See Also:
        Constant Field Values
      • normalizedStringTableIndex

        private static final int normalizedStringTableIndex
        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
      • asciiTypes

        static final byte[] asciiTypes
      • gAvailableConverters

        static java.lang.String[] gAvailableConverters
      • gAvailableConverterCount

        static int gAvailableConverterCount
      • gDefaultConverterName

        static java.lang.String gDefaultConverterName
    • Constructor Detail

      • UConverterAlias

        UConverterAlias()
    • 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)
      • 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-terminated
        name2 - 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