java.util.regex.Matcher.ensureMatch()方法的使用及代码示例

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

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

Matcher.ensureMatch介绍

[英]Makes sure that a successful match has been made. Is invoked internally from various places in the class.
[中]确保成功匹配。从类中的不同位置在内部调用。

代码示例

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

/**
 * Returns the index of the first character following the text that matched
 * a given group.
 *
 * @param group
 *            the group, ranging from 0 to groupCount() - 1, with 0
 *            representing the whole pattern.
 * @return the character index.
 * @throws IllegalStateException
 *             if no successful match has been made.
 */
public int end(int group) {
  ensureMatch();
  return matchOffsets[(group * 2) + 1];
}

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

/**
 * Returns the index of the first character of the text that matched a given
 * group.
 *
 * @param group
 *            the group, ranging from 0 to groupCount() - 1, with 0
 *            representing the whole pattern.
 * @return the character index.
 * @throws IllegalStateException
 *             if no successful match has been made.
 */
public int start(int group) throws IllegalStateException {
  ensureMatch();
  return matchOffsets[group * 2];
}

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

ensureMatch();
int from = matchOffsets[group * 2];
int to = matchOffsets[(group * 2) + 1];

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

/**
 * Converts the current match into a separate {@link MatchResult} instance
 * that is independent from this matcher. The new object is unaffected when
 * the state of this matcher changes.
 *
 * @return the new {@code MatchResult}.
 * @throws IllegalStateException
 *             if no successful match has been made.
 */
public MatchResult toMatchResult() {
  ensureMatch();
  return new MatchResultImpl(input, matchOffsets);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Returns the index of the first character of the text that matched a given
 * group.
 *
 * @param group
 *            the group, ranging from 0 to groupCount() - 1, with 0
 *            representing the whole pattern.
 * @return the character index.
 * @throws IllegalStateException
 *             if no successful match has been made.
 */
public int start(int group) throws IllegalStateException {
  ensureMatch();
  return matchOffsets[group * 2];
}

代码示例来源:origin: MobiVM/robovm

/**
 * Returns the index of the first character following the text that matched
 * a given group.
 *
 * @param group
 *            the group, ranging from 0 to groupCount() - 1, with 0
 *            representing the whole pattern.
 * @return the character index.
 * @throws IllegalStateException
 *             if no successful match has been made.
 */
public int end(int group) {
  ensureMatch();
  return matchOffsets[(group * 2) + 1];
}

代码示例来源:origin: ibinti/bugvm

/**
 * Returns the index of the first character following the text that matched
 * a given group.
 *
 * @param group
 *            the group, ranging from 0 to groupCount() - 1, with 0
 *            representing the whole pattern.
 * @return the character index.
 * @throws IllegalStateException
 *             if no successful match has been made.
 */
public int end(int group) {
  ensureMatch();
  return matchOffsets[(group * 2) + 1];
}

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

/**
 * Returns the index of the first character of the text that matched a given
 * group.
 *
 * @param group
 *            the group, ranging from 0 to groupCount() - 1, with 0
 *            representing the whole pattern.
 * @return the character index.
 * @throws IllegalStateException
 *             if no successful match has been made.
 */
public int start(int group) throws IllegalStateException {
  ensureMatch();
  return matchOffsets[group * 2];
}

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

/**
 * Returns the index of the first character following the text that matched
 * a given group.
 *
 * @param group
 *            the group, ranging from 0 to groupCount() - 1, with 0
 *            representing the whole pattern.
 * @return the character index.
 * @throws IllegalStateException
 *             if no successful match has been made.
 */
public int end(int group) {
  ensureMatch();
  return matchOffsets[(group * 2) + 1];
}

代码示例来源:origin: ibinti/bugvm

/**
 * Returns the index of the first character of the text that matched a given
 * group.
 *
 * @param group
 *            the group, ranging from 0 to groupCount() - 1, with 0
 *            representing the whole pattern.
 * @return the character index.
 * @throws IllegalStateException
 *             if no successful match has been made.
 */
public int start(int group) throws IllegalStateException {
  ensureMatch();
  return matchOffsets[group * 2];
}

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

/**
 * Returns the index of the first character of the text that matched a given
 * group.
 *
 * @param group
 *            the group, ranging from 0 to groupCount() - 1, with 0
 *            representing the whole pattern.
 * @return the character index.
 * @throws IllegalStateException
 *             if no successful match has been made.
 */
public int start(int group) throws IllegalStateException {
  ensureMatch();
  return matchOffsets[group * 2];
}

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

/**
 * Returns the index of the first character following the text that matched
 * a given group.
 *
 * @param group
 *            the group, ranging from 0 to groupCount() - 1, with 0
 *            representing the whole pattern.
 * @return the character index.
 * @throws IllegalStateException
 *             if no successful match has been made.
 */
public int end(int group) {
  ensureMatch();
  return matchOffsets[(group * 2) + 1];
}

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

/**
 * Returns the index of the first character of the text that matched a given
 * group.
 *
 * @param group
 *            the group, ranging from 0 to groupCount() - 1, with 0
 *            representing the whole pattern.
 * @return the character index.
 * @throws IllegalStateException
 *             if no successful match has been made.
 */
public int start(int group) throws IllegalStateException {
  ensureMatch();
  return matchOffsets[group * 2];
}

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

/**
 * Returns the index of the first character following the text that matched
 * a given group.
 *
 * @param group
 *            the group, ranging from 0 to groupCount() - 1, with 0
 *            representing the whole pattern.
 * @return the character index.
 * @throws IllegalStateException
 *             if no successful match has been made.
 */
public int end(int group) {
  ensureMatch();
  return matchOffsets[(group * 2) + 1];
}

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

/**
 * Converts the current match into a separate {@link MatchResult} instance
 * that is independent from this matcher. The new object is unaffected when
 * the state of this matcher changes.
 *
 * @return the new {@code MatchResult}.
 * @throws IllegalStateException
 *             if no successful match has been made.
 */
public MatchResult toMatchResult() {
  ensureMatch();
  return new MatchResultImpl(input, matchOffsets);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Converts the current match into a separate {@link MatchResult} instance
 * that is independent from this matcher. The new object is unaffected when
 * the state of this matcher changes.
 *
 * @return the new {@code MatchResult}.
 * @throws IllegalStateException
 *             if no successful match has been made.
 */
public MatchResult toMatchResult() {
  ensureMatch();
  return new MatchResultImpl(input, matchOffsets);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Converts the current match into a separate {@link MatchResult} instance
 * that is independent from this matcher. The new object is unaffected when
 * the state of this matcher changes.
 *
 * @return the new {@code MatchResult}.
 * @throws IllegalStateException
 *             if no successful match has been made.
 */
public MatchResult toMatchResult() {
  ensureMatch();
  return new MatchResultImpl(input, matchOffsets);
}

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

/**
 * Converts the current match into a separate {@link MatchResult} instance
 * that is independent from this matcher. The new object is unaffected when
 * the state of this matcher changes.
 *
 * @return the new {@code MatchResult}.
 * @throws IllegalStateException
 *             if no successful match has been made.
 */
public MatchResult toMatchResult() {
  ensureMatch();
  return new MatchResultImpl(input, matchOffsets);
}

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

/**
 * Converts the current match into a separate {@link MatchResult} instance
 * that is independent from this matcher. The new object is unaffected when
 * the state of this matcher changes.
 *
 * @return the new {@code MatchResult}.
 * @throws IllegalStateException
 *             if no successful match has been made.
 */
public MatchResult toMatchResult() {
  ensureMatch();
  return new MatchResultImpl(input, matchOffsets);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Converts the current match into a separate {@link MatchResult} instance
 * that is independent from this matcher. The new object is unaffected when
 * the state of this matcher changes.
 *
 * @return the new {@code MatchResult}.
 * @throws IllegalStateException
 *             if no successful match has been made.
 */
public MatchResult toMatchResult() {
  ensureMatch();
  return new MatchResultImpl(input, matchOffsets);
}

相关文章