com.levigo.jadice.search
Interface CharSequenceMatcher

All Known Implementing Classes:
PatternSearchRequest.PatternMatcher

public interface CharSequenceMatcher

Implementations of this interface will provide the logic for searching in the given CharSequence. The findMatches(CharSequence, MatchConsumer) method will be called during the AbstractCharSequenceSearchRequest processing.


Method Summary
 void cancel()
          Tells the CharSequenceMatcher that the current search request has been canceled ( AbstractCharSequenceSearchRequest.cancel().
The 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.
 

Method Detail

findMatches

void findMatches(CharSequence charSequence,
                 MatchConsumer matchConsumer)

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 cancel() method has been called, the implementation of this method has to take care of shutting down as soon as possible.

Parameters:
charSequence - the source text
matchConsumer - the MatchConsumer which will get notified about any matches found.

cancel

void cancel()
Tells the CharSequenceMatcher that the current search request has been canceled ( AbstractCharSequenceSearchRequest.cancel().
The findMatches(CharSequence, MatchConsumer) implementation has to take care that the search loop will be stopped and that the method returns as fast as possible.



Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.