java.lang.Character.isSupplementaryCodePoint()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(138)

本文整理了Java中java.lang.Character.isSupplementaryCodePoint()方法的一些代码示例,展示了Character.isSupplementaryCodePoint()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Character.isSupplementaryCodePoint()方法的具体详情如下:
包路径:java.lang.Character
类名称:Character
方法名:isSupplementaryCodePoint

Character.isSupplementaryCodePoint介绍

[英]Indicates whether codePoint is within the supplementary code point range.
[中]

代码示例

代码示例来源:origin: robovm/robovm

private int indexOfSupplementary(int c, int start) {
  if (!Character.isSupplementaryCodePoint(c)) {
    return -1;
  }
  char[] chars = Character.toChars(c);
  String needle = new String(0, chars.length, chars);
  return indexOf(needle, start);
}

代码示例来源:origin: robovm/robovm

private int lastIndexOfSupplementary(int c, int start) {
  if (!Character.isSupplementaryCodePoint(c)) {
    return -1;
  }
  char[] chars = Character.toChars(c);
  String needle = new String(0, chars.length, chars);
  return lastIndexOf(needle, start);
}

代码示例来源:origin: google/guava

break;
index += Character.isSupplementaryCodePoint(cp) ? 2 : 1;

代码示例来源:origin: robovm/robovm

/**
 * Converts the specified Unicode code point into a UTF-16 encoded sequence
 * and returns it as a char array.
 *
 * @param codePoint
 *            the Unicode code point to encode.
 * @return the UTF-16 encoded char sequence. If {@code codePoint} is a
 *         {@link #isSupplementaryCodePoint(int) supplementary code point},
 *         then the returned array contains two characters, otherwise it
 *         contains just one character.
 * @throws IllegalArgumentException if {@code codePoint} is not a valid code point.
 * @since 1.5
 */
public static char[] toChars(int codePoint) {
  checkValidCodePoint(codePoint);
  if (isSupplementaryCodePoint(codePoint)) {
    int cpPrime = codePoint - 0x10000;
    int high = 0xD800 | ((cpPrime >> 10) & 0x3FF);
    int low = 0xDC00 | (cpPrime & 0x3FF);
    return new char[] { (char) high, (char) low };
  }
  return new char[] { (char) codePoint };
}

代码示例来源:origin: prestodb/presto

break;
index += Character.isSupplementaryCodePoint(cp) ? 2 : 1;

代码示例来源:origin: robovm/robovm

if (isSupplementaryCodePoint(codePoint)) {
  if (dstIndex == dst.length - 1) {
    throw new IndexOutOfBoundsException();

代码示例来源:origin: google/guava

int nextIndex = index + (Character.isSupplementaryCodePoint(cp) ? 2 : 1);
if (escaped != null) {
 int charsSkipped = index - unescapedChunkStart;

代码示例来源:origin: google/j2objc

break;
index += Character.isSupplementaryCodePoint(cp) ? 2 : 1;

代码示例来源:origin: redisson/redisson

break;
index += Character.isSupplementaryCodePoint(cp) ? 2 : 1;

代码示例来源:origin: konsoletyper/teavm

if (!mayContainSupplCodepoints && Character.isSupplementaryCodePoint(ch)) {
  mayContainSupplCodepoints = true;

代码示例来源:origin: redisson/redisson

unescapedChunkStart = index + (Character.isSupplementaryCodePoint(cp) ? 2 : 1);
index = nextEscapeIndex(s, unescapedChunkStart, end);

代码示例来源:origin: redisson/redisson

reader.forward();
c = reader.peek();
if (!Character.isSupplementaryCodePoint(c) && ESCAPE_REPLACEMENTS.containsKey(Character.valueOf((char)c))) {
} else if (!Character.isSupplementaryCodePoint(c) && ESCAPE_CODES.containsKey(Character.valueOf((char)c))) {

代码示例来源:origin: wildfly/wildfly

break;
index += Character.isSupplementaryCodePoint(cp) ? 2 : 1;

代码示例来源:origin: prestodb/presto

int nextIndex = index + (Character.isSupplementaryCodePoint(cp) ? 2 : 1);
if (escaped != null) {
 int charsSkipped = index - unescapedChunkStart;

代码示例来源:origin: redisson/redisson

index += (Character.isSupplementaryCodePoint(cp) ? 2 : 1);
unescapedChunkStart = index;

代码示例来源:origin: prestodb/presto

int codePoint = Integer.parseInt(currentEscapedCode, 16);
check(Character.isValidCodePoint(codePoint), "Invalid escaped character: " + currentEscapedCode, context);
if (Character.isSupplementaryCodePoint(codePoint)) {
  unicodeStringBuilder.appendCodePoint(codePoint);

代码示例来源:origin: google/j2objc

int nextIndex = index + (Character.isSupplementaryCodePoint(cp) ? 2 : 1);
if (escaped != null) {
 int charsSkipped = index - unescapedChunkStart;

代码示例来源:origin: jenkinsci/configuration-as-code-plugin

break;
index += Character.isSupplementaryCodePoint(cp) ? 2 : 1;

代码示例来源:origin: konsoletyper/teavm

int ch = lexemes.next();
if (Character.isSupplementaryCodePoint(ch)) {
  substring.append(Character.toChars(ch));
} else {

代码示例来源:origin: konsoletyper/teavm

private TAbstractSet processCharSet(int ch) {
  boolean isSupplCodePoint = Character.isSupplementaryCodePoint(ch);
  if (hasFlag(TPattern.CASE_INSENSITIVE)) {
    if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) {
      return new TCICharSet((char) ch);
    } else if (hasFlag(TPattern.UNICODE_CASE) && ch > 128) {
      if (isSupplCodePoint) {
        return new TUCISupplCharSet(ch);
      } else if (TLexer.isLowSurrogate(ch)) {
        // we need no UCILowSurrogateCharSet
        return new TLowSurrogateCharSet((char) ch);
      } else if (TLexer.isHighSurrogate(ch)) {
        // we need no UCIHighSurrogateCharSet
        return new THighSurrogateCharSet((char) ch);
      } else {
        return new TUCICharSet((char) ch);
      }
    }
  }
  if (isSupplCodePoint) {
    return new TSupplCharSet(ch);
  } else if (TLexer.isLowSurrogate(ch)) {
    return new TLowSurrogateCharSet((char) ch);
  } else if (TLexer.isHighSurrogate(ch)) {
    return new THighSurrogateCharSet((char) ch);
  } else {
    return new TCharSet((char) ch);
  }
}

相关文章

微信公众号

最新文章

更多

Character类方法