java.lang.StringBuilder.codePointBefore()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(126)

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

StringBuilder.codePointBefore介绍

暂无

代码示例

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

/**
 * Possible states in which the current readline operation may be in.
 */
private static enum State {
  /**
   * The user is just typing away
   */
  NORMAL,
  /**
   * In the middle of a emacs seach
   */
  SEARCH,
  FORWARD_SEARCH,
  /**
   * VI "yank-to" operation ("y" during move mode)
   */
  VI_YANK_TO,
  /**
   * VI "delete-to" operation ("d" during move mode)
   */
  VI_DELETE_TO,
  /**
   * VI "change-to" operation ("c" during move mode)
   */
  VI_CHANGE_TO
}

代码示例来源:origin: com.github.javaito/hcjf

public int codePointBefore(int index) {
  return builder.codePointBefore(index);
}

代码示例来源:origin: jp.dodododo/samurai-dao

public int codePointBefore(int index) {
  return delegator.codePointBefore(index);
}

代码示例来源:origin: me.soliveirajr/menta-bean

public int codePointBefore(int index) {
  return sb.codePointBefore(index);
}

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

@Override
@JTranscAsync
public synchronized int codePointBefore(int index) {
  return super.codePointBefore(index);
}

代码示例来源:origin: apache/sis

/**
 * Returns {@code true} if the name of the given code is the prefix of a word in the datum name.
 * We do not test the characters following the prefix because the word may be incomplete
 * (e.g. {@code "geoid"} versus {@code "geoidal"}).
 *
 * <p>This method is public as an implementation side-effect and should be ignored.</p>
 *
 * @param  code  the code to test.
 * @return {@code true} if the code matches the criterion.
 */
@Override
public boolean accept(final CodeList<?> code) {
  final int i = datum.indexOf(code.name());
  return (i == 0) || (i >= 0 && Character.isWhitespace(datum.codePointBefore(i)));
}

代码示例来源:origin: org.apache.sis.core/sis-metadata

/**
 * Returns {@code true} if the name of the given code is the prefix of a word in the datum name.
 * We do not test the characters following the prefix because the word may be incomplete
 * (e.g. {@code "geoid"} versus {@code "geoidal"}).
 *
 * <p>This method is public as an implementation side-effect and should be ignored.</p>
 *
 * @param  code  the code to test.
 * @return {@code true} if the code matches the criterion.
 */
@Override
public boolean accept(final CodeList<?> code) {
  final int i = datum.indexOf(code.name());
  return (i == 0) || (i >= 0 && Character.isWhitespace(datum.codePointBefore(i)));
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/**
 * Return the previous character in the normalized text and decrement
 * the iteration position by one.  If the beginning
 * of the text has already been reached, {@link #DONE} is returned.
 * @return The codepoint as an int
 * @deprecated ICU 56
 */
@Deprecated
public int previous() {
  if(bufferPos>0 || previousNormalize()) {
    int c=buffer.codePointBefore(bufferPos);
    bufferPos-=Character.charCount(c);
    return c;
  } else {
    return DONE;
  }
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

private int previousCC() {  // Returns 0 if there is no previous character.
  codePointLimit=codePointStart;
  if(reorderStart>=codePointStart) {
    return 0;
  }
  int c=str.codePointBefore(codePointStart);
  codePointStart-=Character.charCount(c);
  if(c<MIN_CCC_LCCC_CP) {
    return 0;
  }
  return getCCFromYesOrMaybe(impl.getNorm16(c));
}

代码示例来源:origin: omegat-org/omegat

boolean isPossibleBreakBefore(int pos) {
  try {
    // check previous char. Can't split after specified chars.
    int cp = str.codePointBefore(pos);
    // U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    // U+201E DOUBLE LOW-9 QUOTATION MARK
    if (":\\([{<\u00ab\u201e".indexOf(cp) >= 0) {
      return false;
    }
  } catch (StringIndexOutOfBoundsException ex) {
  }
  try {
    // check next char. Can't split before specified chars.
    int cp = str.codePointAt(pos);
    // U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    // U+201C LEFT DOUBLE QUOTATION MARK
    if ("{:)]}>\u00bb\u201c,.".indexOf(cp) >= 0) {
      return false;
    }
  } catch (StringIndexOutOfBoundsException ex) {
  }
  return true;
}

代码示例来源:origin: crvv/android_wubi_input

/**
 * Apply a processed event.
 * @param event the event to be applied
 */
public void applyProcessedEvent(final Event event) {
  if (null != event) {
    // TODO: figure out the generic way of doing this
    if (Constants.CODE_DELETE == event.mKeyCode) {
      final int length = mCombinedText.length();
      if (length > 0) {
        final int lastCodePoint = mCombinedText.codePointBefore(length);
        mCombinedText.delete(length - Character.charCount(lastCodePoint), length);
      }
    } else {
      final CharSequence textToCommit = event.getTextToCommit();
      if (!TextUtils.isEmpty(textToCommit)) {
        mCombinedText.append(textToCommit);
      }
    }
  }
  updateStateFeedback();
}

代码示例来源:origin: omegat-org/omegat

return;
int cp = str.codePointBefore(str.length());
if (cp == '\n' || cp == '\r') {
  cp = str.codePointBefore(str.length());
  if (cp == '\n' || cp == '\r') {
    eol1 = (char) cp;

代码示例来源:origin: omegat-org/omegat

@Override
public void write(char[] cbuf, int off, int len) throws IOException {
  for (int cp, i = 0; i < len; i += Character.charCount(cp)) {
    cp = Character.codePointAt(cbuf, off + i);
    if (breakChars > 0 && cp == str.codePointBefore(str.length())) {
      // the same eol char - flush
      outLine();
    }
    if (cp == '\n' || cp == '\r') {
      str.appendCodePoint(cp);
      breakChars++;
      if (breakChars > 1) {
        // 2 eol chars - flush
        outLine();
      }
    } else {
      if (breakChars > 0) {
        // was eol char - flush
        outLine();
      }
      str.appendCodePoint(cp);
    }
  }
}

代码示例来源:origin: opengeospatial/geoapi

final int cp = buffer.codePointBefore(lg);
if (isWhitespace(cp) || cp == '_') {
  buffer.setLength(lg - charCount(cp));

代码示例来源:origin: org.apache.sis.core/sis-utility

final int cp = buffer.codePointBefore(lg);
if (isWhitespace(cp)) {
  buffer.setLength(lg - charCount(cp));

代码示例来源:origin: apache/sis

final int cp = buffer.codePointBefore(lg);
if (isWhitespace(cp)) {
  buffer.setLength(lg - charCount(cp));

代码示例来源:origin: apache/sis

if (buffer.codePointBefore(end) == ')') end--;
for (int n=0, columnIndex=0; n < indices.length; columnIndex++) {
  int start = end;
  for (int c; (c = buffer.codePointBefore(start)) != ',';) {
    start -= Character.charCount(c);
    if (c == '\'') {
      while (true) {
        c = buffer.codePointBefore(start);
        start -= Character.charCount(c);
        if (c == '\'') {
          if (buffer.codePointBefore(start) != '\'') {
            break;

代码示例来源:origin: apache/sis

if (!Character.isUnicodeIdentifierPart(buffer.codePointBefore(i))) {
  final int end = i + length;
  if (!Character.isUnicodeIdentifierPart(buffer.codePointAt(end))) {

代码示例来源:origin: com.typesafe.sbt/incremental-compiler

/**
 * Possible states in which the current readline operation may be in.
 */
private static enum State {
  /**
   * The user is just typing away
   */
  NORMAL,
  /**
   * In the middle of a emacs seach
   */
  SEARCH,
  FORWARD_SEARCH,
  /**
   * VI "yank-to" operation ("y" during move mode)
   */
  VI_YANK_TO,
  /**
   * VI "delete-to" operation ("d" during move mode)
   */
  VI_DELETE_TO,
  /**
   * VI "change-to" operation ("c" during move mode)
   */
  VI_CHANGE_TO
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

return c;
} else if(state.compareTo(State.IN_NORM_ITER_AT_LIMIT) >= 0 && pos != 0) {
  c = normalized.codePointBefore(pos);
  pos -= Character.charCount(c);
  return c;

相关文章

微信公众号

最新文章

更多