当前位置: 首页>>代码示例>>Java>>正文


Java UTF16.getLeadSurrogate方法代码示例

本文整理汇总了Java中com.ibm.icu.text.UTF16.getLeadSurrogate方法的典型用法代码示例。如果您正苦于以下问题:Java UTF16.getLeadSurrogate方法的具体用法?Java UTF16.getLeadSurrogate怎么用?Java UTF16.getLeadSurrogate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ibm.icu.text.UTF16的用法示例。


在下文中一共展示了UTF16.getLeadSurrogate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkNullNextTrailIndex

import com.ibm.icu.text.UTF16; //导入方法依赖的package包/类
/**
* Checks if we are beginning at the start of a initial block.
* If we are then the rest of the codepoints in this initial block
* has the same values.
* We increment m_nextCodepoint_ and relevant data members if so.
* This is used only in for the supplementary codepoints because
* the offset to the trail indexes could be 0.
* @return true if we are at the start of a initial block.
*/
private final boolean checkNullNextTrailIndex()
{
    if (m_nextIndex_ <= 0) {
        m_nextCodepoint_ += TRAIL_SURROGATE_COUNT_ - 1;
        int nextLead  = UTF16.getLeadSurrogate(m_nextCodepoint_);
        int leadBlock =
               m_trie_.m_index_[nextLead >> Trie.INDEX_STAGE_1_SHIFT_] <<
                                               Trie.INDEX_STAGE_2_SHIFT_;
        if (m_trie_.m_dataManipulate_ == null) {
            throw new NullPointerException(
                        "The field DataManipulate in this Trie is null");
        }
        m_nextIndex_ = m_trie_.m_dataManipulate_.getFoldingOffset(
                           m_trie_.getValue(leadBlock +
                               (nextLead & Trie.INDEX_STAGE_3_MASK_)));
        m_nextIndex_ --;
        m_nextBlockIndex_ =  DATA_BLOCK_LENGTH_;
        return true;
    }
    return false;
}
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:31,代码来源:TrieIterator.java

示例2: mayHaveLccc

import com.ibm.icu.text.UTF16; //导入方法依赖的package包/类
static boolean mayHaveLccc(int c) {
    // Handles all of Unicode 0..10FFFF.
    // c can be negative, e.g., Collation.SENTINEL_CP.
    // U+0300 is the first character with lccc!=0.
    if(c < 0x300) { return false; }
    if(c > 0xffff) { c = UTF16.getLeadSurrogate(c); }
    int i;
    return
        (i = lcccIndex[c >> 5]) != 0 &&
        (lcccBits[i] & (1 << (c & 0x1f))) != 0;
}
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:12,代码来源:CollationFCD.java


注:本文中的com.ibm.icu.text.UTF16.getLeadSurrogate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。