本文整理汇总了Java中com.ibm.icu.lang.UCharacter.MAX_VALUE属性的典型用法代码示例。如果您正苦于以下问题:Java UCharacter.MAX_VALUE属性的具体用法?Java UCharacter.MAX_VALUE怎么用?Java UCharacter.MAX_VALUE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.ibm.icu.lang.UCharacter
的用法示例。
在下文中一共展示了UCharacter.MAX_VALUE属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getValue
/**
* Get a 32 bit data from the table data
* @param ch code point for which data is to be retrieved.
* @param inBlockZero Output parameter, inBlockZero[0] returns true if the
* char maps into block zero, otherwise false.
* @return the 32 bit data value.
*/
public int getValue(int ch, boolean [] inBlockZero)
{
// valid, uncompacted trie and valid c?
if (m_isCompacted_ || ch > UCharacter.MAX_VALUE || ch < 0) {
if (inBlockZero != null) {
inBlockZero[0] = true;
}
return 0;
}
int block = m_index_[ch >> SHIFT_];
if (inBlockZero != null) {
inBlockZero[0] = (block == 0);
}
return m_data_[Math.abs(block) + (ch & MASK_)];
}
示例2: setValue
/**
* Sets a 32 bit data in the table data
* @param ch codepoint which data is to be set
* @param value to set
* @return true if the set is successful, otherwise
* if the table has been compacted return false
*/
public boolean setValue(int ch, int value)
{
// valid, uncompacted trie and valid c?
if (m_isCompacted_ || ch > UCharacter.MAX_VALUE || ch < 0) {
return false;
}
int block = getDataBlock(ch);
if (block < 0) {
return false;
}
m_data_[block + (ch & MASK_)] = value;
return true;
}
示例3: getCodePointOffset
/**
* Internal trie getter from a code point.
* Could be faster(?) but longer with
* if((c32)<=0xd7ff) { (result)=_TRIE_GET_RAW(trie, data, 0, c32); }
* Gets the offset to data which the codepoint points to
* @param ch codepoint
* @return offset to data
*/
protected final int getCodePointOffset(int ch)
{
// if ((ch >> 16) == 0) slower
if (ch < 0) {
return -1;
} else if (ch < UTF16.LEAD_SURROGATE_MIN_VALUE) {
// fastpath for the part of the BMP below surrogates (D800) where getRawOffset() works
return getRawOffset(0, (char)ch);
} else if (ch < UTF16.SUPPLEMENTARY_MIN_VALUE) {
// BMP codepoint
return getBMPOffset((char)ch);
} else if (ch <= UCharacter.MAX_VALUE) {
// look at the construction of supplementary characters
// trail forms the ends of it.
return getSurrogateOffset(UTF16.getLeadSurrogate(ch),
(char)(ch & SURROGATE_MASK_));
} else {
// return -1 if there is an error, in this case we return
return -1;
}
}
示例4: getName
/**
* Retrieve the name of a Unicode code point.
* Depending on <code>choice</code>, the character name written into the
* buffer is the "modern" name or the name that was defined in Unicode
* version 1.0.
* The name contains only "invariant" characters
* like A-Z, 0-9, space, and '-'.
*
* @param ch the code point for which to get the name.
* @param choice Selector for which name to get.
* @return if code point is above 0x1fff, null is returned
*/
public String getName(int ch, int choice)
{
if (ch < UCharacter.MIN_VALUE || ch > UCharacter.MAX_VALUE ||
choice > UCharacterNameChoice.CHAR_NAME_CHOICE_COUNT) {
return null;
}
String result = null;
result = getAlgName(ch, choice);
// getting normal character name
if (result == null || result.length() == 0) {
if (choice == UCharacterNameChoice.EXTENDED_CHAR_NAME) {
result = getExtendedName(ch);
} else {
result = getGroupName(ch, choice);
}
}
return result;
}
示例5: isInZeroBlock
/**
* Checks if the character belongs to a zero block in the trie
* @param ch codepoint which data is to be retrieved
* @return true if ch is in the zero block
*/
public boolean isInZeroBlock(int ch)
{
// valid, uncompacted trie and valid c?
if (m_isCompacted_ || ch > UCharacter.MAX_VALUE
|| ch < UCharacter.MIN_VALUE) {
return true;
}
return m_index_[ch >> SHIFT_] == 0;
}
示例6: next
/**
* <p>Returns true if we are not at the end of the iteration, false
* otherwise.</p>
* <p>The next set of codepoints with the same value type will be
* calculated during this call and returned in the arguement element.</p>
* @param element return result
* @return true if we are not at the end of the iteration, false otherwise.
* @exception NoSuchElementException - if no more elements exist.
* @see com.ibm.icu.util.RangeValueIterator.Element
*/
@Override
public final boolean next(Element element)
{
if (m_nextCodepoint_ > UCharacter.MAX_VALUE) {
return false;
}
if (m_nextCodepoint_ < UCharacter.SUPPLEMENTARY_MIN_VALUE &&
calculateNextBMPElement(element)) {
return true;
}
calculateNextSupplementaryElement(element);
return true;
}
示例7: setInfo
/**
* Sets the information for accessing the algorithmic names
* @param rangestart starting code point that lies within this name group
* @param rangeend end code point that lies within this name group
* @param type algorithm type. There's 2 kinds of algorithmic type. First
* which uses code point as part of its name and the other uses
* variant postfix strings
* @param variant algorithmic variant
* @return true if values are valid
*/
boolean setInfo(int rangestart, int rangeend, byte type, byte variant)
{
if (rangestart >= UCharacter.MIN_VALUE && rangestart <= rangeend
&& rangeend <= UCharacter.MAX_VALUE &&
(type == TYPE_0_ || type == TYPE_1_)) {
m_rangestart_ = rangestart;
m_rangeend_ = rangeend;
m_type_ = type;
m_variant_ = variant;
return true;
}
return false;
}