Class AbstractStringMatcher.AndStringMatcher

    • Field Detail

      • stringMatchers

        private final StringMatcher[] stringMatchers
        Matchers in order.
    • Method Detail

      • isMatch

        public int isMatch​(char[] buffer,
                           int start,
                           int bufferStart,
                           int bufferEnd)
        Description copied from interface: StringMatcher
        Returns the number of matching characters, 0 if there is no match.

        This method is called to check for a match against a source buffer. The parameter start represents the start position to be checked in the buffer (a character array which MUST not be changed). The implementation SHOULD guarantees that start is a valid index in buffer.

        The character array may be larger than the active area to be matched. Only values in the buffer between the specified indices may be accessed, in other words: bufferStart <= start < bufferEnd.

        The matching code may check one character or many. It may check characters preceding start as well as those after, so long as no checks exceed the bounds specified.

        It must return zero for no match, or a positive number if a match was found. The number indicates the number of characters that matched.

        Parameters:
        buffer - the source text to search, do not change.
        start - the starting position for the match, valid in buffer.
        bufferStart - the first active index in the buffer, valid in buffer.
        bufferEnd - the end index (exclusive) of the active buffer, valid in buffer.
        Returns:
        The number of matching characters, zero if there is no match.
      • isMatch

        public int isMatch​(java.lang.CharSequence buffer,
                           int start,
                           int bufferStart,
                           int bufferEnd)
        Description copied from interface: StringMatcher
        Returns the number of matching characters, 0 if there is no match.

        This method is called to check for a match against a source buffer. The parameter start represents the start position to be checked in the buffer (a character array which MUST not be changed). The implementation SHOULD guarantees that start is a valid index in buffer.

        The character array may be larger than the active area to be matched. Only values in the buffer between the specified indices may be accessed, in other words: bufferStart <= start < bufferEnd.

        The matching code may check one character or many. It may check characters preceding start as well as those after, so long as no checks exceed the bounds specified.

        It must return zero for no match, or a positive number if a match was found. The number indicates the number of characters that matched.

        Parameters:
        buffer - the source text to search, do not change.
        start - the starting position for the match, valid in buffer.
        bufferStart - the first active index in the buffer, valid in buffer.
        bufferEnd - the end index (exclusive) of the active buffer, valid in buffer.
        Returns:
        The number of matching characters, zero if there is no match.
      • size

        public int size()
        Description copied from interface: StringMatcher
        Returns the size of the matching string. Defaults to 0.
        Returns:
        the size of the matching string.