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

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

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

Character.codePointAtImpl介绍

暂无

代码示例

代码示例来源:origin: org.apidesign.bck2brwsr/emul.mini

/**
 * Returns the code point at the given index of the
 * {@code char} array. If the {@code char} value at
 * the given index in the {@code char} array is in the
 * high-surrogate range, the following index is less than the
 * length of the {@code char} array, and the
 * {@code char} value at the following index is in the
 * low-surrogate range, then the supplementary code point
 * corresponding to this surrogate pair is returned. Otherwise,
 * the {@code char} value at the given index is returned.
 *
 * @param a the {@code char} array
 * @param index the index to the {@code char} values (Unicode
 * code units) in the {@code char} array to be converted
 * @return the Unicode code point at the given index
 * @exception NullPointerException if {@code a} is null.
 * @exception IndexOutOfBoundsException if the value
 * {@code index} is negative or not less than
 * the length of the {@code char} array.
 * @since  1.5
 */
public static int codePointAt(char[] a, int index) {
  return codePointAtImpl(a, index, a.length);
}

代码示例来源:origin: jtulach/bck2brwsr

/**
 * Returns the code point at the given index of the
 * {@code char} array. If the {@code char} value at
 * the given index in the {@code char} array is in the
 * high-surrogate range, the following index is less than the
 * length of the {@code char} array, and the
 * {@code char} value at the following index is in the
 * low-surrogate range, then the supplementary code point
 * corresponding to this surrogate pair is returned. Otherwise,
 * the {@code char} value at the given index is returned.
 *
 * @param a the {@code char} array
 * @param index the index to the {@code char} values (Unicode
 * code units) in the {@code char} array to be converted
 * @return the Unicode code point at the given index
 * @exception NullPointerException if {@code a} is null.
 * @exception IndexOutOfBoundsException if the value
 * {@code index} is negative or not less than
 * the length of the {@code char} array.
 * @since  1.5
 */
public static int codePointAt(char[] a, int index) {
  return codePointAtImpl(a, index, a.length);
}

代码示例来源:origin: jtulach/bck2brwsr

throw new IndexOutOfBoundsException();
return codePointAtImpl(a, index, limit);

代码示例来源:origin: org.apidesign.bck2brwsr/emul.mini

throw new IndexOutOfBoundsException();
return codePointAtImpl(a, index, limit);

代码示例来源:origin: jtulach/bck2brwsr

/**
 * Returns the character (Unicode code point) at the specified
 * index. The index refers to <code>char</code> values
 * (Unicode code units) and ranges from <code>0</code> to
 * {@link #length()}<code> - 1</code>.
 *
 * <p> If the <code>char</code> value specified at the given index
 * is in the high-surrogate range, the following index is less
 * than the length of this <code>String</code>, and the
 * <code>char</code> value at the following index is in the
 * low-surrogate range, then the supplementary code point
 * corresponding to this surrogate pair is returned. Otherwise,
 * the <code>char</code> value at the given index is returned.
 *
 * @param      index the index to the <code>char</code> values
 * @return     the code point value of the character at the
 *             <code>index</code>
 * @exception  IndexOutOfBoundsException  if the <code>index</code>
 *             argument is negative or not less than the length of this
 *             string.
 * @since      1.5
 */
public int codePointAt(int index) {
  if ((index < 0) || (index >= length())) {
    throw new StringIndexOutOfBoundsException(index);
  }
  return Character.codePointAtImpl(toCharArray(), offset() + index, offset() + length());
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul.mini

/**
 * Returns the character (Unicode code point) at the specified
 * index. The index refers to <code>char</code> values
 * (Unicode code units) and ranges from <code>0</code> to
 * {@link #length()}<code> - 1</code>.
 *
 * <p> If the <code>char</code> value specified at the given index
 * is in the high-surrogate range, the following index is less
 * than the length of this <code>String</code>, and the
 * <code>char</code> value at the following index is in the
 * low-surrogate range, then the supplementary code point
 * corresponding to this surrogate pair is returned. Otherwise,
 * the <code>char</code> value at the given index is returned.
 *
 * @param      index the index to the <code>char</code> values
 * @return     the code point value of the character at the
 *             <code>index</code>
 * @exception  IndexOutOfBoundsException  if the <code>index</code>
 *             argument is negative or not less than the length of this
 *             string.
 * @since      1.5
 */
public int codePointAt(int index) {
  if ((index < 0) || (index >= length())) {
    throw new StringIndexOutOfBoundsException(index);
  }
  return Character.codePointAtImpl(toCharArray(), offset() + index, offset() + length());
}

代码示例来源:origin: stackoverflow.com

//Java 8 java.lang.String source code
public int codePointAt(int index) {
  if ((index < 0) || (index >= value.length)) {
    throw new StringIndexOutOfBoundsException(index);
  }
  return Character.codePointAtImpl(value, index, value.length);
}
//...
public int codePointBefore(int index) {
  int i = index - 1;
  if ((i < 0) || (i >= value.length)) {
    throw new StringIndexOutOfBoundsException(index);
  }
  return Character.codePointBeforeImpl(value, index, 0);
}

相关文章

Character类方法