Interface StringMatcher
-
public interface StringMatcher
Determines if a character array portion matches.- Since:
- 1.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
isMatch(char[] buffer, int pos, int bufferStart, int bufferEnd)
Returns the number of matching characters, zero for no match.
-
-
-
Method Detail
-
isMatch
int isMatch(char[] buffer, int pos, int bufferStart, int bufferEnd)
Returns the number of matching characters, zero for no match.This method is called to check for a match. The parameter
pos
represents the current position to be checked in the stringbuffer
(a character array which must not be changed). The API guarantees thatpos
is a valid index forbuffer
.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.
The matching code may check one character or many. It may check characters preceding
pos
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 text content to match against, do not changepos
- the starting position for the match, valid for bufferbufferStart
- the first active index in the buffer, valid for bufferbufferEnd
- the end index (exclusive) of the active buffer, valid for buffer- Returns:
- the number of matching characters, or zero if there is no match
-
-