本文整理了Java中java.lang.Character.codePointBefore()
方法的一些代码示例,展示了Character.codePointBefore()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Character.codePointBefore()
方法的具体详情如下:
包路径:java.lang.Character
类名称:Character
方法名:codePointBefore
[英]Returns the code point that precedes index in the specified sequence of character units. If the unit at index - 1 is a low-surrogate unit, index - 2 is not negative and the unit at index - 2 is a high-surrogate unit, then the supplementary code point represented by the pair is returned; otherwise the charvalue at index - 1 is returned.
[中]返回指定字符单位序列中索引前面的代码点。如果索引-1处的单元是低代理单元,索引-2不是负的,并且索引-2处的单元是高代理单元,则返回由该对表示的补充码点;否则,将返回索引-1处的charvalue。
代码示例来源:origin: libgdx/libgdx
/** Retrieves the Unicode code point value that precedes the {@code index}.
*
* @param index the index to the {@code char} code unit within this object.
* @return the Unicode code point value.
* @throws IndexOutOfBoundsException if {@code index} is less than 1 or greater than {@link #length()}.
* @see Character
* @see Character#codePointBefore(char[], int, int)
* @since 1.5 */
public int codePointBefore (int index) {
if (index < 1 || index > length) {
throw new StringIndexOutOfBoundsException(index);
}
return Character.codePointBefore(chars, index);
}
代码示例来源:origin: libgdx/libgdx
/** Retrieves the Unicode code point value that precedes the {@code index}.
*
* @param index the index to the {@code char} code unit within this object.
* @return the Unicode code point value.
* @throws IndexOutOfBoundsException if {@code index} is less than 1 or greater than {@link #length()}.
* @see Character
* @see Character#codePointBefore(char[], int, int)
* @since 1.5 */
public int codePointBefore (int index) {
if (index < 1 || index > length) {
throw new StringIndexOutOfBoundsException(index);
}
return Character.codePointBefore(chars, index);
}
代码示例来源:origin: wildfly/wildfly
public int peekPrev() throws NoSuchElementException {
if (! hasPrev()) throw new NoSuchElementException();
return Character.codePointBefore(chars, offs + idx);
}
代码示例来源:origin: wildfly/wildfly
public int peekPrevious() throws NoSuchElementException {
if (! hasPrevious()) throw new NoSuchElementException();
return Character.codePointBefore(chars, offs + idx);
}
代码示例来源:origin: robovm/robovm
/**
* Returns the Unicode code point that precedes the given {@code index}.
*
* @throws IndexOutOfBoundsException if {@code index < 1 || index > length()}
* @see Character#codePointBefore(char[], int, int)
* @since 1.5
*/
public int codePointBefore(int index) {
if (index < 1 || index > count) {
throw indexAndLength(index);
}
return Character.codePointBefore(value, offset + index, offset);
}
代码示例来源:origin: robovm/robovm
/**
* Retrieves the Unicode code point value that precedes the {@code index}.
*
* @param index
* the index to the {@code char} code unit within this object.
* @return the Unicode code point value.
* @throws IndexOutOfBoundsException
* if {@code index} is less than 1 or greater than
* {@link #length()}.
* @see Character
* @see Character#codePointBefore(char[], int, int)
* @since 1.5
*/
public int codePointBefore(int index) {
if (index < 1 || index > count) {
throw indexAndLength(index);
}
return Character.codePointBefore(value, index);
}
代码示例来源:origin: KronicDeth/intellij-elixir
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos/*, zzStartRead*/);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + ZZ_CMAP(zzInput) ];
代码示例来源:origin: stanfordnlp/CoreNLP
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos, zzStartRead);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + zzCMapL[zzInput] ];
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos, zzStartRead);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + zzCMapL[zzInput] ];
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos, zzStartRead);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + zzCMapL[zzInput] ];
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos, zzStartRead);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + zzCMapL[zzInput] ];
代码示例来源:origin: stanfordnlp/CoreNLP
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos, zzStartRead);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + zzCMapL[zzInput] ];
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos, zzStartRead);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + zzCMapL[zzInput] ];
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos, zzStartRead);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + zzCMapL[zzInput] ];
代码示例来源:origin: google/re2j
@Override
int context(int pos) {
pos += start;
int r1 = pos > start && pos <= end ? Character.codePointBefore(str, pos) : -1;
int r2 = pos < end ? Character.codePointAt(str, pos) : -1;
return Utils.emptyOpContext(r1, r2);
}
代码示例来源:origin: oracle/opengrok
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos, zzStartRead);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + zzCMapL[zzInput] ];
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos, zzStartRead);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + zzCMapL[zzInput] ];
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos, zzStartRead);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + zzCMapL[zzInput] ];
代码示例来源:origin: oracle/opengrok
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos, zzStartRead);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + zzCMapL[zzInput] ];
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos, zzStartRead);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + zzCMapL[zzInput] ];
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos, zzStartRead);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + zzCMapL[zzInput] ];
代码示例来源:origin: KronicDeth/intellij-elixir
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos/*, zzStartRead*/);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + ZZ_CMAP(zzInput) ];
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos/*, zzStartRead*/);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + ZZ_CMAP(zzInput) ];
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos/*, zzStartRead*/);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + ZZ_CMAP(zzInput) ];
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos/*, zzStartRead*/);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + ZZ_CMAP(zzInput) ];
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos/*, zzStartRead*/);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + ZZ_CMAP(zzInput) ];
代码示例来源:origin: oracle/opengrok
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos, zzStartRead);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + zzCMapL[zzInput] ];
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos, zzStartRead);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + zzCMapL[zzInput] ];
代码示例来源:origin: oracle/opengrok
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos, zzStartRead);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + zzCMapL[zzInput] ];
zzFPos = zzMarkedPos;
while (!zzFinL[zzFPos] || (zzAttrL[zzFState] & 1) != 1) {
zzInput = Character.codePointBefore(zzBufferL, zzFPos, zzStartRead);
zzFPos -= Character.charCount(zzInput);
zzFState = zzTransL[ zzRowMapL[zzFState] + zzCMapL[zzInput] ];
代码示例来源:origin: io.virtdata/virtdata-lib-realer
@Override
public int previousCodePoint() {
if(pos == 0) {
return Collation.SENTINEL_CP;
}
int c = Character.codePointBefore(s, pos);
pos -= Character.charCount(c);
return c;
}
代码示例来源:origin: rkkr/simple-keyboard
public int getCodePointBeforeCursor() {
final int length = mCommittedTextBeforeComposingText.length();
if (length < 1) return Constants.NOT_A_CODE;
return Character.codePointBefore(mCommittedTextBeforeComposingText, length);
}
代码示例来源:origin: MichaelRocks/CallMeMaybe
private int indexOfLastDigit(final int start, final int end) {
int offset = end;
while (offset > start) {
final int codePoint = Character.codePointBefore(this, offset);
offset -= Character.charCount(codePoint);
if (Character.isDigit(codePoint)) {
return offset;
}
}
return -1;
}
}
代码示例来源:origin: MobiVM/robovm
/**
* Returns the Unicode code point that precedes the given {@code index}.
*
* @throws IndexOutOfBoundsException if {@code index < 1 || index > length()}
* @see Character#codePointBefore(char[], int, int)
* @since 1.5
*/
public int codePointBefore(int index) {
if (index < 1 || index > count) {
throw indexAndLength(index);
}
return Character.codePointBefore(value, offset + index, offset);
}
代码示例来源:origin: ibinti/bugvm
/**
* Returns the Unicode code point that precedes the given {@code index}.
*
* @throws IndexOutOfBoundsException if {@code index < 1 || index > length()}
* @see Character#codePointBefore(char[], int, int)
* @since 1.5
*/
public int codePointBefore(int index) {
if (index < 1 || index > count) {
throw indexAndLength(index);
}
return Character.codePointBefore(value, offset + index, offset);
}
内容来源于网络,如有侵权,请联系作者删除!