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


Java UCharacter.isUnicodeIdentifierPart方法代码示例

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


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

示例1: parseReference

import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
public String parseReference(String text, ParsePosition pos, int limit) {
    int start = pos.getIndex();
    int i = start;
    String result = "";
    while (i < limit) {
        int c = UTF16.charAt(text, i);
        if ((i == start && !UCharacter.isUnicodeIdentifierStart(c))
                || !UCharacter.isUnicodeIdentifierPart(c)) {
            break;
        }
        i += UTF16.getCharCount(c);
    }
    if (i == start) { // No valid name chars
        return result; // Indicate failure with empty string
    }
    pos.setIndex(i);
    result = text.substring(start, i);
    return result;
}
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:20,代码来源:RBBISymbolTable.java

示例2: parseReference

import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
/**
 * Implement SymbolTable API.  Parse out a symbol reference
 * name.
 */
@Override
public String parseReference(String text, ParsePosition pos, int limit) {
    int start = pos.getIndex();
    int i = start;
    while (i < limit) {
        char c = text.charAt(i);
        if ((i==start && !UCharacter.isUnicodeIdentifierStart(c)) ||
            !UCharacter.isUnicodeIdentifierPart(c)) {
            break;
        }
        ++i;
    }
    if (i == start) { // No valid name chars
        return null;
    }
    pos.setIndex(i);
    return text.substring(start, i);
}
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:23,代码来源:TransliteratorParser.java

示例3: parseUnicodeIdentifier

import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
/**
 * Parse a Unicode identifier from the given string at the given
 * position.  Return the identifier, or null if there is no
 * identifier.
 * @param str the string to parse
 * @param pos INPUT-OUPUT parameter.  On INPUT, pos[0] is the
 * first character to examine.  It must be less than str.length(),
 * and it must not point to a whitespace character.  That is, must
 * have pos[0] < str.length().  On
 * OUTPUT, the position after the last parsed character.
 * @return the Unicode identifier, or null if there is no valid
 * identifier at pos[0].
 */
public static String parseUnicodeIdentifier(String str, int[] pos) {
    // assert(pos[0] < str.length());
    StringBuilder buf = new StringBuilder();
    int p = pos[0];
    while (p < str.length()) {
        int ch = Character.codePointAt(str, p);
        if (buf.length() == 0) {
            if (UCharacter.isUnicodeIdentifierStart(ch)) {
                buf.appendCodePoint(ch);
            } else {
                return null;
            }
        } else {
            if (UCharacter.isUnicodeIdentifierPart(ch)) {
                buf.appendCodePoint(ch);
            } else {
                break;
            }
        }
        p += UTF16.getCharCount(ch);
    }
    pos[0] = p;
    return buf.toString();
}
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:38,代码来源:Utility.java

示例4: isUnicodeIdentifierPart

import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
/**
 * Indicates whether the specified code point is valid as part of a Unicode
 * identifier other than the first character.
 * 
 * @param codePoint
 *            the code point to check.
 * @return {@code true} if {@code codePoint} is valid as part of a Unicode
 *         identifier; {@code false} otherwise.
 */
public static boolean isUnicodeIdentifierPart(int codePoint) {
    return UCharacter.isUnicodeIdentifierPart(codePoint);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:13,代码来源:Character.java

示例5: isUnicodeIdentifierPart

import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
/**
 * Answers whether the character is valid as part of a Unicode identifier as
 * other than the first character.
 * 
 * @param codePoint
 *            the character, including supplementary characters
 * @return true when the character is valid as part of a Unicode identifier,
 *         false otherwise
 */
public static boolean isUnicodeIdentifierPart(int codePoint) {
    return UCharacter.isUnicodeIdentifierPart(codePoint);
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:13,代码来源:Character.java


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