本文整理了Java中java.lang.Character.codePointAtImpl()
方法的一些代码示例,展示了Character.codePointAtImpl()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Character.codePointAtImpl()
方法的具体详情如下:
包路径:java.lang.Character
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!