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


Java Utf16Util.traverseUtf16String方法代码示例

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


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

示例1: extractCodePoints

import org.waveprotocol.wave.model.util.Utf16Util; //导入方法依赖的package包/类
/**
 * Extracts code points from a given character string.
 *
 * @param chars a character string from which to extract code points
 * @return the code points extracted from the given string
 */
private static List<Integer> extractCodePoints(String chars) throws InvalidSchemaException {
  List<Integer> codePoints = Utf16Util.traverseUtf16String(chars, codePointExtractor);
  if (codePoints == ERROR_LIST) {
    throw new InvalidSchemaException("Invalid code point in string: " + chars);
  }
  return codePoints;
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:14,代码来源:SchemaFactory.java

示例2: isValidIdentifier

import org.waveprotocol.wave.model.util.Utf16Util; //导入方法依赖的package包/类
/**
 * Checks whether a UTF-16 string is a valid wave identifier.
 */
public static boolean isValidIdentifier(String id) {
  return !id.isEmpty() && Utf16Util.traverseUtf16String(id, GOOD_UTF16_FOR_ID);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:7,代码来源:WaveIdentifiers.java

示例3: validate

import org.waveprotocol.wave.model.util.Utf16Util; //导入方法依赖的package包/类
/**
 * Checks whether the given characters are valid.
 *
 * @param characters the characters to check
 * @return -1 if the characters are all valid, or otherwise the number of
 *         valid Unicode characters before the first invalid character
 */
int validate(String characters) {
  return Utf16Util.traverseUtf16String(characters, new ValidatingHandler(predicate));
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:11,代码来源:CharacterValidator.java


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