protected static final class PatternSearchRequest.PatternMatcher extends Object implements CharSequenceMatcher
Constructor and Description |
---|
PatternMatcher(Pattern[] patterns) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Tells the
CharSequenceMatcher that the current
search request has been canceled (
AbstractCharSequenceSearchRequest.cancel() .The CharSequenceMatcher.findMatches(CharSequence, MatchConsumer) implementation has to take care that the
search loop will be stopped and that the method returns as fast as possible. |
void |
findMatches(CharSequence charSequence,
MatchConsumer matchConsumer)
Runs the search for some sequence of characters.
|
public PatternMatcher(Pattern[] patterns)
public void findMatches(CharSequence charSequence, MatchConsumer matchConsumer)
CharSequenceMatcher
Runs the search for some sequence of characters. Implementations are free
to decide how to search for matches in the given CharSequence
.
Results found have to be provided to the
MatchConsumer.match(int, int)
or
MatchConsumer.match(int, int, Object)
methods.
IMPORTANT: If the CharSequenceMatcher.cancel()
method has been called, the
implementation of this method has to take care of shutting down as soon as
possible.
findMatches
in interface CharSequenceMatcher
charSequence
- the source textmatchConsumer
- the MatchConsumer
which will get notified
about any matches found.public void cancel()
CharSequenceMatcher
CharSequenceMatcher
that the current
search request
has been canceled (
AbstractCharSequenceSearchRequest.cancel()
.CharSequenceMatcher.findMatches(CharSequence, MatchConsumer)
implementation has to take care that the
search loop will be stopped and that the method returns as fast as possible.cancel
in interface CharSequenceMatcher
Copyright © 2024 levigo holding gmbh. All rights reserved.