public class SearchEngine extends java.lang.Object implements SearchResultConsumer, PluginLoader.PluginLoaderListener
Modifier and Type | Class and Description |
---|---|
static interface |
SearchEngine.SearchEngineListener |
Constructor and Description |
---|
SearchEngine() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(SearchEngine.SearchEngineListener listener) |
void |
cancelSearch()
Cancel the previous search request
|
java.lang.String |
getLastSearch()
Returns the last search text.
|
java.util.List<SearchEngine.SearchEngineListener> |
getListeners() |
SearchResult |
getResult(int index)
Returns SearchResult at specified index.
|
java.util.List<SearchResult> |
getResults()
Return all current results from all
SearchResultProducer . |
int |
getSearchingProducerCount()
Returns the number of currently producer processing a search request.
|
java.util.List<SearchResultProducer> |
getSearchResultProducers()
Returns
SearchResultProducer attached to the search engine. |
boolean |
isSearching()
Returns true if the search engine is currently processing a search request.
|
void |
pluginLoaderChanged(PluginLoader.PluginLoaderEvent e) |
void |
removeListener(SearchEngine.SearchEngineListener listener) |
void |
resultChanged(SearchResultProducer producer,
SearchResult result)
Notify consumer than a single result has just been modified.
|
void |
resultsChanged(SearchResultProducer producer)
Notify consumer than results list changed.
|
void |
search(java.lang.String text)
Performs the search request, mostly build the search result list.
|
void |
searchCompleted(SearchResultProducer producer)
Notify consumer than search request completed.
|
public SearchEngine()
public void cancelSearch()
public void search(java.lang.String text)
text
- Text used for the search request, it can contains several words and use operators.cancelSearch()
public java.util.List<SearchResultProducer> getSearchResultProducers()
SearchResultProducer
attached to the search engine.public int getSearchingProducerCount()
public boolean isSearching()
public java.lang.String getLastSearch()
public SearchResult getResult(int index)
public java.util.List<SearchResult> getResults()
SearchResultProducer
.public void pluginLoaderChanged(PluginLoader.PluginLoaderEvent e)
pluginLoaderChanged
in interface PluginLoader.PluginLoaderListener
public void resultChanged(SearchResultProducer producer, SearchResult result)
SearchResultConsumer
resultChanged
in interface SearchResultConsumer
public void resultsChanged(SearchResultProducer producer)
SearchResultConsumer
resultsChanged
in interface SearchResultConsumer
public void searchCompleted(SearchResultProducer producer)
SearchResultConsumer
searchCompleted
in interface SearchResultConsumer
public java.util.List<SearchEngine.SearchEngineListener> getListeners()
public void addListener(SearchEngine.SearchEngineListener listener)
public void removeListener(SearchEngine.SearchEngineListener listener)