public class AndMatcher extends StringMatcher
StringMatcher
tests whether strings match both given StringMatcher
instances.Constructor and Description |
---|
AndMatcher(StringMatcher matcher1,
StringMatcher matcher2)
Creates a new AndMatcher with the two given string matchers.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
matches(java.lang.String string,
int beginOffset,
int endOffset)
Checks whether the given substring matches.
|
java.lang.String |
prefix()
Returns a common prefix of all strings matched by this
StringMatcher . |
matches
public AndMatcher(StringMatcher matcher1, StringMatcher matcher2)
public java.lang.String prefix()
StringMatcher
StringMatcher
. If the returned
value is null, then this StringMatcher
does not match any string.prefix
in class StringMatcher
protected boolean matches(java.lang.String string, int beginOffset, int endOffset)
StringMatcher
matches
in class StringMatcher
string
- the string to match.beginOffset
- the start offset of the substring (inclusive).endOffset
- the end offset of the substring (exclusive).