Class Match.Group<E>

  • Type Parameters:
    E -
    Enclosing class:
    Match<E>

    public static class Match.Group<E>
    extends java.lang.Object
    A captured group in a matched expression.
    • Method Detail

      • addTokens

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

        public java.util.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 java.lang.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object