Class Match.Group<E>

java.lang.Object
edu.washington.cs.knowitall.regex.Match.Group<E>
Type Parameters:
E -
Enclosing class:
Match<E>

public static class Match.Group<E> extends Object
A captured group in a matched expression.
  • Field Details

  • Constructor Details

  • Method Details

    • addTokens

      protected void addTokens(Match.Group<E> group)
      Add tokens to the group.
      Parameters:
      group -
    • tokens

      public List<E> tokens()
      Returns:
      the tokens matched.
    • startIndex

      public int startIndex()
      Returns:
      the index of the first token in this group or -1
    • endIndex

      public int endIndex()
      Returns:
      the index of the last token in this group or -1
    • text

      public String text()
      A string representation of the group. This is a lighter-weight representation than toString.
    • tokenCount

      public int tokenCount()
      Returns:
      the number of tokens matched.
    • toString

      public String toString()
      Overrides:
      toString in class Object