public abstract class SearchInfo extends Object
Constructor and Description |
---|
SearchInfo() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
canSearch()
Checks that searching is possible.
|
protected abstract Iterator<FileObject> |
createFilesToSearchIterator(SearchScopeOptions options,
SearchListener listener,
AtomicBoolean terminated)
Create
Iterator that iterates over all files in the search scope
that comply with search options and search filters. |
protected abstract Iterator<URI> |
createUrisToSearchIterator(SearchScopeOptions options,
SearchListener listener,
AtomicBoolean terminated)
Create
Iterator that iterates over all URIs in the search scope
that comply with search options and search filters. |
Iterable<FileObject> |
getFilesToSearch(SearchScopeOptions options,
SearchListener listener,
AtomicBoolean terminated)
Get
Iterable that iterates over all files in the search scope
that comply with search options and search filters. |
abstract List<SearchRoot> |
getSearchRoots()
Get search roots.
|
Iterable<URI> |
getUrisToSearch(SearchScopeOptions options,
SearchListener listener,
AtomicBoolean terminated)
Get
Iterable that iterates over all URIs in the search scope
that comply with search options and search filters. |
public abstract boolean canSearch()
@NonNull public abstract List<SearchRoot> getSearchRoots()
@NonNull protected abstract Iterator<FileObject> createFilesToSearchIterator(@NonNull SearchScopeOptions options, @NonNull SearchListener listener, @NonNull AtomicBoolean terminated)
Iterator
that iterates over all files in the search scope
that comply with search options and search filters.options
- Custom options. This object encapsulates custom search
filters, file name pattern and general search settings.listener
- Listener that is notified when some important event
occurs during searching. Listener passed to SearchComposition
should be used here.terminated
- Object that can be asked by the iterator whether
the search has been terminated.@NonNull protected abstract Iterator<URI> createUrisToSearchIterator(@NonNull SearchScopeOptions options, @NonNull SearchListener listener, @NonNull AtomicBoolean terminated)
Iterator
that iterates over all URIs in the search scope
that comply with search options and search filters.options
- Custom options. This object encapsulates custom search
filters, file name pattern and general search settings.listener
- Listener that is notified when some important event
occurs during searching. Listener passed to SearchComposition
should be used here.terminated
- Object that can be asked by the iterator whether the
search has been terminated.@NonNull public final Iterable<FileObject> getFilesToSearch(@NonNull SearchScopeOptions options, @NonNull SearchListener listener, @NonNull AtomicBoolean terminated)
Iterable
that iterates over all files in the search scope
that comply with search options and search filters.options
- Custom options. This object encapsulates custom search
filters, file name pattern and general search settings.listener
- Listener that is notified when some important event
occurs during searching. Listener passed to SearchComposition
should be used here.terminated
- Object that can be asked by the iterator whether
the search has been terminated.
This method can be used in for-each loops:
for (FileObject fo: searchInfo.getFilesToSearch(opts,listnr,term) {
ResultType result = somehowCheckFileContentMatches(fo);
if (result != null) {
searchResultsDisplayer.addMatchingObject(result);
}
}
@NonNull public final Iterable<URI> getUrisToSearch(@NonNull SearchScopeOptions options, @NonNull SearchListener listener, @NonNull AtomicBoolean terminated)
Iterable
that iterates over all URIs in the search scope
that comply with search options and search filters.options
- Custom options. This object encapsulates custom search
filters, file name pattern and general search settings.listener
- Listener that is notified when some important event
occurs during searching. Listener passed to SearchComposition
should be used here.terminated
- Object that can be asked by the iterator whether
the search has been terminated.
This method can be used in for-each loops:
for (URI uri: searchInfo.getUrisToSearch(opts,listnr,term) {
ResultType result = somehowCheckFileContentMatches(fo);
if (result != null) {
searchResultsDisplayer.addMatchingObject(result);
}
}