Class 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 Detail

      • startIndex

        private final int startIndex
      • tokens

        private final java.util.List<E> tokens
      • groups

        private final java.util.List<Match.Group<E>> groups
    • Constructor Detail

      • FinalMatch

        protected FinalMatch​(Match<E> m)
    • Method Detail

      • 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 java.util.List<E> tokens()
        Specified by:
        tokens in class Match<E>
        Returns:
        all matched tokens.
      • groups

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