本文整理了Java中java.lang.Character.offsetByCodePoints()
方法的一些代码示例,展示了Character.offsetByCodePoints()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Character.offsetByCodePoints()
方法的具体详情如下:
包路径:java.lang.Character
类名称:Character
方法名:offsetByCodePoints
[英]Determines the index in the specified character sequence that is offset codePointOffset code points from index.
[中]确定指定字符序列中偏移代码点偏移代码点的索引。
代码示例来源:origin: libgdx/libgdx
/** Returns the index that is offset {@code codePointOffset} code points from {@code index}.
*
* @param index the index to calculate the offset from.
* @param codePointOffset the number of code points to count.
* @return the index that is {@code codePointOffset} code points away from index.
* @throws IndexOutOfBoundsException if {@code index} is negative or greater than {@link #length()} or if there aren't enough
* code points before or after {@code index} to match {@code codePointOffset}.
* @see Character
* @see Character#offsetByCodePoints(char[], int, int, int, int)
* @since 1.5 */
public int offsetByCodePoints (int index, int codePointOffset) {
return Character.offsetByCodePoints(chars, 0, length, index, codePointOffset);
}
代码示例来源:origin: libgdx/libgdx
/** Returns the index that is offset {@code codePointOffset} code points from {@code index}.
*
* @param index the index to calculate the offset from.
* @param codePointOffset the number of code points to count.
* @return the index that is {@code codePointOffset} code points away from index.
* @throws IndexOutOfBoundsException if {@code index} is negative or greater than {@link #length()} or if there aren't enough
* code points before or after {@code index} to match {@code codePointOffset}.
* @see Character
* @see Character#offsetByCodePoints(char[], int, int, int, int)
* @since 1.5 */
public int offsetByCodePoints (int index, int codePointOffset) {
return Character.offsetByCodePoints(chars, 0, length, index, codePointOffset);
}
代码示例来源:origin: robovm/robovm
/**
* Returns the index within this object that is offset from {@code index} by
* {@code codePointOffset} code points.
*
* @param index
* the index within this object to calculate the offset from.
* @param codePointOffset
* the number of code points to count.
* @return the index within this object that is the offset.
* @throws IndexOutOfBoundsException
* if {@code index} is negative or greater than {@code length()}
* or if there aren't enough code points before or after {@code
* index} to match {@code codePointOffset}.
* @since 1.5
*/
public int offsetByCodePoints(int index, int codePointOffset) {
int s = index + offset;
int r = Character.offsetByCodePoints(value, offset, count, s, codePointOffset);
return r - offset;
}
代码示例来源:origin: robovm/robovm
/**
* Returns the index that is offset {@code codePointOffset} code points from
* {@code index}.
*
* @param index
* the index to calculate the offset from.
* @param codePointOffset
* the number of code points to count.
* @return the index that is {@code codePointOffset} code points away from
* index.
* @throws IndexOutOfBoundsException
* if {@code index} is negative or greater than
* {@link #length()} or if there aren't enough code points
* before or after {@code index} to match
* {@code codePointOffset}.
* @see Character
* @see Character#offsetByCodePoints(char[], int, int, int, int)
* @since 1.5
*/
public int offsetByCodePoints(int index, int codePointOffset) {
return Character.offsetByCodePoints(value, 0, count, index,
codePointOffset);
}
}
代码示例来源:origin: wildfly/wildfly
public int previous() {
if (! hasPrevious()) throw new NoSuchElementException();
idx = Character.offsetByCodePoints(chars, offs, len, offs + idx, - 1) - offs;
offset--;
return Character.codePointAt(chars, offs + idx);
}
代码示例来源:origin: wildfly/wildfly
public int prev() {
if (! hasPrev()) throw new NoSuchElementException();
idx = Character.offsetByCodePoints(chars, offs, len, offs + idx, -1) - offs;
offset--;
return Character.codePointAt(chars, offs + idx);
}
代码示例来源:origin: apache/geode
/**
* Utility method to take a string and convert it to normal Java variable name capitalization.
*
* @param name The string to be made in camel case.
* @return The camel case version of the string.
*/
public static String decapitalize(String name) {
if (name == null || name.length() == 0) {
return name;
}
int offset1 = Character.offsetByCodePoints(name, 0, 1);
if (offset1 < name.length() && Character.isUpperCase(name.codePointAt(offset1)))
return name;
return name.substring(0, offset1).toLowerCase() + name.substring(offset1);
}
代码示例来源:origin: wildfly/wildfly
public int next() {
if (! hasNext()) throw new NoSuchElementException();
try {
offset++;
return Character.codePointAt(chars, offs + idx);
} finally {
idx = Character.offsetByCodePoints(chars, offs, len, offs + idx, 1) - offs;
}
}
代码示例来源:origin: wildfly/wildfly
public int next() {
if (! hasNext()) throw new NoSuchElementException();
try {
offset++;
return Character.codePointAt(chars, offs + idx);
} finally {
idx = Character.offsetByCodePoints(chars, offs, len, offs + idx, 1) - offs;
}
}
代码示例来源:origin: oracle/opengrok
case 8:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzMarkedPos, -1);
case 9:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 2);
代码示例来源:origin: KronicDeth/intellij-elixir
case 13:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL/*, zzStartRead, zzEndRead - zzStartRead*/, zzMarkedPos, -3);
{ yybegin(YYINITIAL);
代码示例来源:origin: stanfordnlp/CoreNLP
case 23:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzMarkedPos, -1);
{ return getNext();
case 31:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzMarkedPos, -1);
{ String txt = yytext();
case 36:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzMarkedPos, -2);
{ return getNext();
代码示例来源:origin: stanfordnlp/CoreNLP
case 19:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzMarkedPos, -1);
{ return getNext();
case 30:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzMarkedPos, -2);
{ return getNext();
代码示例来源:origin: oracle/opengrok
case 20:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 1);
{ chkLOC(); yybegin(TBLL);
代码示例来源:origin: oracle/opengrok
case 17:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 3);
{ yypush(JAVADOC);
代码示例来源:origin: oracle/opengrok
case 15:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzMarkedPos, -1);
{ chkLOC();
case 18:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzMarkedPos, -1);
{ chkLOC();
case 19:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 2);
{ chkLOC();
case 20:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzMarkedPos, -2);
{ chkLOC();
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 2);
{ chkLOC();
代码示例来源:origin: oracle/opengrok
case 21:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 3);
{ if (nestedComment++ == 0) {
代码示例来源:origin: oracle/opengrok
case 19:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 1);
{ h.chkLOC();
case 26:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 1);
{ h.chkLOC();
代码示例来源:origin: oracle/opengrok
case 19:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 1);
{ h.chkLOC();
case 26:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 1);
{ h.chkLOC();
代码示例来源:origin: oracle/opengrok
case 20:
zzMarkedPos = Character.offsetByCodePoints
(zzBufferL, zzStartRead, zzEndRead - zzStartRead, zzStartRead, 3);
{ if (nestedComment++ == 0) {
内容来源于网络,如有侵权,请联系作者删除!