• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CharArrayIntMap类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.xml.internal.fastinfoset.util.CharArrayIntMap的典型用法代码示例。如果您正苦于以下问题:Java CharArrayIntMap类的具体用法?Java CharArrayIntMap怎么用?Java CharArrayIntMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CharArrayIntMap类属于com.sun.xml.internal.fastinfoset.util包,在下文中一共展示了CharArrayIntMap类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: encodeNonIdentifyingStringOnFirstBit

import com.sun.xml.internal.fastinfoset.util.CharArrayIntMap; //导入依赖的package包/类
/**
 * Encode a non identifying string on the first bit of an octet.
 * Implementation of clause C.14 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
 *
 * @param ch the array of characters.
 * @param offset the offset into the array of characters.
 * @param length the length of characters.
 * @param map the vocabulary table of character arrays to indexes.
 * @param addToTable true if the string should be added to the vocabulary
 *                   table (if not already present in the table).
 * @param clone true if the array of characters should be cloned if added
 *              to the vocabulary table.
 */
protected final void encodeNonIdentifyingStringOnFirstBit(char[] ch, int offset, int length, CharArrayIntMap map,
        boolean addToTable, boolean clone) throws IOException {
    if (length == 0) {
        // C.26 an index (first bit '1') with seven '1' bits for an empty string
        write(0xFF);
    } else {
        if (addToTable) {
            // if char array could be added to table
            boolean canAddCharacterContentToTable =
                    canAddCharacterContentToTable(length, map);

            // obtain/get index
            int index = canAddCharacterContentToTable ?
                map.obtainIndex(ch, offset, length, clone) :
                map.get(ch, offset, length);

            if (index != KeyIntMap.NOT_PRESENT) {
                // if char array is in table
                encodeNonZeroIntegerOnSecondBitFirstBitOne(index);
            } else if (canAddCharacterContentToTable) {
                // if char array is not in table, but could be added
                _b = EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG |
                        _nonIdentifyingStringOnFirstBitCES;
                encodeNonEmptyCharacterStringOnFifthBit(ch, offset, length);
            } else {
                // if char array is not in table and could not be added
                _b = _nonIdentifyingStringOnFirstBitCES;
                encodeNonEmptyCharacterStringOnFifthBit(ch, offset, length);
            }
        } else {
            _b = _nonIdentifyingStringOnFirstBitCES;
            encodeNonEmptyCharacterStringOnFifthBit(ch, offset, length);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:49,代码来源:Encoder.java


示例2: encodeNonIdentifyingStringOnThirdBit

import com.sun.xml.internal.fastinfoset.util.CharArrayIntMap; //导入依赖的package包/类
/**
 * Encode a non identifying string on the third bit of an octet.
 * Implementation of clause C.15 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
 *
 * @param ch the array of characters.
 * @param offset the offset into the array of characters.
 * @param length the length of characters.
 * @param map the vocabulary table of character arrays to indexes.
 * @param addToTable true if the array of characters should be added to the vocabulary
 *                   table (if not already present in the table).
 * @param clone true if the array of characters should be cloned if added
 *              to the vocabulary table.
 */
protected final void encodeNonIdentifyingStringOnThirdBit(char[] ch, int offset, int length,
        CharArrayIntMap map, boolean addToTable, boolean clone) throws IOException {
    // length cannot be zero since sequence of CIIs has to be > 0

    if (addToTable) {
        // if char array could be added to table
        boolean canAddCharacterContentToTable =
                canAddCharacterContentToTable(length, map);

        // obtain/get index
        int index = canAddCharacterContentToTable ?
            map.obtainIndex(ch, offset, length, clone) :
            map.get(ch, offset, length);

        if (index != KeyIntMap.NOT_PRESENT) {
            // if char array is in table
            _b = EncodingConstants.CHARACTER_CHUNK | 0x20;
            encodeNonZeroIntegerOnFourthBit(index);
        } else if (canAddCharacterContentToTable) {
            // if char array is not in table, but could be added
            _b = EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG |
                    _nonIdentifyingStringOnThirdBitCES;
            encodeNonEmptyCharacterStringOnSeventhBit(ch, offset, length);
        } else {
            // if char array is not in table and could not be added
                _b = _nonIdentifyingStringOnThirdBitCES;
                encodeNonEmptyCharacterStringOnSeventhBit(ch, offset, length);
        }
    } else {
        // char array will not be added to map
        _b = _nonIdentifyingStringOnThirdBitCES;
        encodeNonEmptyCharacterStringOnSeventhBit(ch, offset, length);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:48,代码来源:Encoder.java


示例3: SerializerVocabulary

import com.sun.xml.internal.fastinfoset.util.CharArrayIntMap; //导入依赖的package包/类
public SerializerVocabulary() {
    tables[RESTRICTED_ALPHABET] = restrictedAlphabet = new StringIntMap(4);
    tables[ENCODING_ALGORITHM] = encodingAlgorithm = new StringIntMap(4);
    tables[PREFIX] = prefix = new FixedEntryStringIntMap(EncodingConstants.XML_NAMESPACE_PREFIX, 8);
    tables[NAMESPACE_NAME] = namespaceName = new FixedEntryStringIntMap(EncodingConstants.XML_NAMESPACE_NAME, 8);
    tables[LOCAL_NAME] = localName = new StringIntMap();
    tables[OTHER_NCNAME] = otherNCName = new StringIntMap(4);
    tables[OTHER_URI] = otherURI = new StringIntMap(4);
    tables[ATTRIBUTE_VALUE] = attributeValue = new StringIntMap();
    tables[OTHER_STRING] = otherString = new CharArrayIntMap(4);
    tables[CHARACTER_CONTENT_CHUNK] = characterContentChunk = new CharArrayIntMap();
    tables[ELEMENT_NAME] = elementName = new LocalNameQualifiedNamesMap();
    tables[ATTRIBUTE_NAME] = attributeName = new LocalNameQualifiedNamesMap();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:SerializerVocabulary.java


示例4: addToTable

import com.sun.xml.internal.fastinfoset.util.CharArrayIntMap; //导入依赖的package包/类
private void addToTable(String s, CharArrayIntMap m) {
    if (s.length() == 0) {
        return;
    }

    char[] c = s.toCharArray();
    m.obtainIndex(c, 0, c.length, false);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:SerializerVocabulary.java


示例5: canAddCharacterContentToTable

import com.sun.xml.internal.fastinfoset.util.CharArrayIntMap; //导入依赖的package包/类
/**
 * Checks whether character content table has enough memory to
 * store character content chunk with the given length
 *
 * @param length the length of character content chunk is checking to be added to Map.
 * @param map the custom CharArrayIntMap, which memory limits will be checked.
 * @return whether character content map has enough memory
 */
public boolean canAddCharacterContentToTable(int length, CharArrayIntMap map) {
    return map.getTotalCharacterCount() + length <
                    characterContentChunkMapTotalCharactersConstraint;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:Encoder.java



注:本文中的com.sun.xml.internal.fastinfoset.util.CharArrayIntMap类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ServerUtils类代码示例发布时间:2022-05-23
下一篇:
Java WSDLDescriptorKind类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap