Interface Searcher.ResultReceiver
-
- Enclosing class:
- Searcher
public static interface Searcher.ResultReceiver
An interface that is sent search results and progress updates as the search proceeds.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addResult(Searcher source, Member member, int line, java.lang.String context, int start, int end)
Called when a new match is found.void
searchCompleted(Searcher source)
Called when the search is completed, regardless of whether it completes normally or is cancelled.void
setFileCount(Searcher source, int count)
Called to inform the receiver of the total number of files being scanned.void
setFinishedFileCount(Searcher source, int fileCount)
Called periodically to update the receiver with the number of files that have been scanned so far.
-
-
-
Method Detail
-
addResult
void addResult(Searcher source, Member member, int line, java.lang.String context, int start, int end)
Called when a new match is found.- Parameters:
source
- the instance that is performing the searchmember
- the member that matched the patternline
- the line number within the member that matched; this will be 0 if the match is in the file name, or -1 for binary filescontext
- a snippet of the text surrounding the matchstart
- the start of the match, relative to the start of the context stringend
- the end of the match, relative to the start of the context string
-
setFileCount
void setFileCount(Searcher source, int count)
Called to inform the receiver of the total number of files being scanned.- Parameters:
source
- the instance that is performing the searchcount
- the number of files scanned so far
-
setFinishedFileCount
void setFinishedFileCount(Searcher source, int fileCount)
Called periodically to update the receiver with the number of files that have been scanned so far.- Parameters:
source
- the instance that is performing the searchfileCount
- the total number of searched files
-
searchCompleted
void searchCompleted(Searcher source)
Called when the search is completed, regardless of whether it completes normally or is cancelled.- Parameters:
source
- the instance that was performing the search
-
-