Package com.ibm.icu.util

Examples of com.ibm.icu.util.VersionInfo


        if (readICUHeader) {
            byte[] UnicodeVersion = ICUBinary.readHeader(inputStream, DATA_FORMAT_ID_,
                                 UCA_AUTHENTICATE_);
            // weiv: check that we have the correct Unicode version in
            // binary files
            VersionInfo UCDVersion = UCharacter.getUnicodeVersion();
            if(UnicodeVersion[0] != UCDVersion.getMajor()
            || UnicodeVersion[1] != UCDVersion.getMinor()) {
                throw new IOException(WRONG_UNICODE_VERSION_ERROR_);
            }
        }
        m_dataInputStream_ = new DataInputStream(inputStream);
    }
View Full Code Here


         byte[] UnicodeVersion = ICUBinary.readHeader(inputStream, INVERSE_UCA_DATA_FORMAT_ID_,
                              INVERSE_UCA_AUTHENTICATE_);
                             
        // weiv: check that we have the correct Unicode version in
        // binary files
        VersionInfo UCDVersion = UCharacter.getUnicodeVersion();
        if(UnicodeVersion[0] != UCDVersion.getMajor()
        || UnicodeVersion[1] != UCDVersion.getMinor()) {
            throw new IOException(WRONG_UNICODE_VERSION_ERROR_);
        }
                             
        CollationParsedRuleBuilder.InverseUCA result =
                                  new CollationParsedRuleBuilder.InverseUCA();
View Full Code Here

        version[0] = input.readByte();
        version[1] = input.readByte();
        version[2] = input.readByte();
        version[3] = input.readByte();
       
        VersionInfo result =
        VersionInfo.getInstance(
            (int)version[0], (int)version[1],
            (int)version[2], (int)version[3]);
       
        return result;
View Full Code Here

        if (readICUHeader) {
            byte[] UnicodeVersion = ICUBinary.readHeader(inputStream, DATA_FORMAT_ID_,
                                 UCA_AUTHENTICATE_);
            // weiv: check that we have the correct Unicode version in
            // binary files
            VersionInfo UCDVersion = UCharacter.getUnicodeVersion();
            if(UnicodeVersion[0] != UCDVersion.getMajor()
            || UnicodeVersion[1] != UCDVersion.getMinor()) {
                throw new IOException(WRONG_UNICODE_VERSION_ERROR_);
            }
        }
        m_dataInputStream_ = new DataInputStream(inputStream);
    }
View Full Code Here

         byte[] UnicodeVersion = ICUBinary.readHeader(inputStream, INVERSE_UCA_DATA_FORMAT_ID_,
                              INVERSE_UCA_AUTHENTICATE_);
                             
        // weiv: check that we have the correct Unicode version in
        // binary files
        VersionInfo UCDVersion = UCharacter.getUnicodeVersion();
        if(UnicodeVersion[0] != UCDVersion.getMajor()
        || UnicodeVersion[1] != UCDVersion.getMinor()) {
            throw new IOException(WRONG_UNICODE_VERSION_ERROR_);
        }
                             
        CollationParsedRuleBuilder.InverseUCA result =
                                  new CollationParsedRuleBuilder.InverseUCA();
View Full Code Here

        version[0] = input.readByte();
        version[1] = input.readByte();
        version[2] = input.readByte();
        version[3] = input.readByte();
       
        VersionInfo result =
        VersionInfo.getInstance(
            (int)version[0], (int)version[1],
            (int)version[2], (int)version[3]);
       
        return result;
View Full Code Here

                case UProperty.AGE:
                {
                    // Must munge name, since
                    // VersionInfo.getInstance() does not do
                    // 'loose' matching.
                    VersionInfo version = VersionInfo.getInstance(mungeCharName(valueAlias));
                    applyFilter(new VersionFilter(version), UCharacterProperty.SRC_PROPSVEC);
                    return this;
                }
                }
View Full Code Here

    private static class VersionFilter implements Filter {
        VersionInfo version;
        VersionFilter(VersionInfo version) { this.version = version; }
        public boolean contains(int ch) {
            VersionInfo v = UCharacter.getAge(ch);
            // Reference comparison ok; VersionInfo caches and reuses
            // unique objects.
            return v != NO_VERSION &&
            v.compareTo(version) <= 0;
        }
View Full Code Here

     * @return TRUE if ICU_DATA_VERSION is newer than icuver, else FALSE
     */
    public static boolean isDataOlder(VersionInfo dataVersionFillin) {
        boolean result = true;
       
        VersionInfo dataVersion = getDataVersion();
       
        if (dataVersion!= null) {
            if (dataVersion.compareTo(VersionInfo.ICU_DATA_VERSION) != -1) {
                result = false;
            }
           
            if (dataVersionFillin != null) {
                dataVersionFillin = VersionInfo.getInstance(dataVersion.toString());
            }
        }
       
        return result;
    }
View Full Code Here

        // get the options
        doNFKC            = ((indexes[OPTIONS] & NORMALIZATION_ON) > 0);
        checkBiDi         = ((indexes[OPTIONS] & CHECK_BIDI_ON) > 0);
        sprepUniVer   = getVersionInfo(reader.getUnicodeVersion());
        normCorrVer   = getVersionInfo(indexes[NORM_CORRECTNS_LAST_UNI_VERSION]);
        VersionInfo normUniVer = UCharacter.getUnicodeVersion();
        if(normUniVer.compareTo(sprepUniVer) < 0 && /* the Unicode version of SPREP file must be less than the Unicode Vesion of the normalization data */
           normUniVer.compareTo(normCorrVer) < 0 && /* the Unicode version of the NormalizationCorrections.txt file should be less than the Unicode Vesion of the normalization data */
           ((indexes[OPTIONS] & NORMALIZATION_ON) > 0) /* normalization turned on*/
           ){
            throw new IOException("Normalization Correction version not supported");
        }
        b.close();
View Full Code Here

TOP

Related Classes of com.ibm.icu.util.VersionInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.