Class Match.FinalMatch<E>

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

protected static final class Match.FinalMatch<E> extends Match<E>
A match representation that has efficient method calls but is immutable.
  • Field Details

    • startIndex

      private final int startIndex
    • tokens

      private final List<E> tokens
    • groups

      private final List<Match.Group<E>> groups
  • Constructor Details

    • FinalMatch

      protected FinalMatch(Match<E> m)
  • Method Details

    • startIndex

      public int startIndex()
      Specified by:
      startIndex in class Match<E>
      Returns:
      the index of the first token matched (inclusive start).
    • endIndex

      public int endIndex()
      Specified by:
      endIndex in class Match<E>
      Returns:
      the index one past of the last token matched (exclusive end).
    • tokens

      public List<E> tokens()
      Specified by:
      tokens in class Match<E>
      Returns:
      all matched tokens.
    • groups

      public List<Match.Group<E>> groups()
      Specified by:
      groups in class Match<E>
      Returns:
      all matching groups (named and unnamed).