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

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

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

Character.checkValidCodePoint介绍

暂无

代码示例

代码示例来源: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: robovm/robovm

checkValidCodePoint(codePoint);
if (dst == null) {
  throw new NullPointerException("dst == null");

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

checkValidCodePoint(codePoint);
if (getType(codePoint) == Character.UNASSIGNED) {
  return null;

代码示例来源:origin: MobiVM/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: ibinti/bugvm

/**
 * 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: com.mobidevelop.robovm/robovm-rt

/**
 * 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: com.bugvm/bugvm-rt

/**
 * 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: com.gluonhq/robovm-rt

/**
 * 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: FlexoVM/flexovm

/**
 * 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: MobiVM/robovm

checkValidCodePoint(codePoint);
if (dst == null) {
  throw new NullPointerException("dst == null");

代码示例来源:origin: ibinti/bugvm

checkValidCodePoint(codePoint);
if (dst == null) {
  throw new NullPointerException("dst == null");

代码示例来源:origin: com.bugvm/bugvm-rt

checkValidCodePoint(codePoint);
if (dst == null) {
  throw new NullPointerException("dst == null");

代码示例来源:origin: com.gluonhq/robovm-rt

checkValidCodePoint(codePoint);
if (dst == null) {
  throw new NullPointerException("dst == null");

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

checkValidCodePoint(codePoint);
if (dst == null) {
  throw new NullPointerException("dst == null");

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

checkValidCodePoint(codePoint);
if (getType(codePoint) == Character.UNASSIGNED) {
  return null;

代码示例来源:origin: FlexoVM/flexovm

checkValidCodePoint(codePoint);
if (getType(codePoint) == Character.UNASSIGNED) {
  return null;

代码示例来源:origin: ibinti/bugvm

checkValidCodePoint(codePoint);
if (getType(codePoint) == Character.UNASSIGNED) {
  return null;

代码示例来源:origin: com.bugvm/bugvm-rt

checkValidCodePoint(codePoint);
if (getType(codePoint) == Character.UNASSIGNED) {
  return null;

代码示例来源:origin: com.gluonhq/robovm-rt

checkValidCodePoint(codePoint);
if (getType(codePoint) == Character.UNASSIGNED) {
  return null;

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

checkValidCodePoint(codePoint);
if (getType(codePoint) == Character.UNASSIGNED) {
  return null;

相关文章

Character类方法