javax.help.search
public abstract class SearchQuery extends java.lang.Object
SearchEvent
,
SearchListener
Modifier and Type | Field and Description |
---|---|
protected SearchEngine |
hs |
protected java.util.Locale |
l |
protected EventListenerList |
listenerList |
protected java.lang.String |
searchparams |
Constructor and Description |
---|
SearchQuery(SearchEngine hs)
Creates a SearchQuery.
|
Modifier and Type | Method and Description |
---|---|
void |
addSearchListener(SearchListener l)
Adds a listener for the SearchEngine posted after the search has
started, stopped, or search parameters have been defined.
|
protected void |
fireItemsFound(boolean inSearch,
java.util.Vector docs)
Notifies that a SearchItem has been found.
|
protected void |
fireItemsFound(SearchEvent e)
Passs through that a SearchEvent has happened.
|
protected void |
fireSearchFinished()
Notifies that a search has completed.
|
protected void |
fireSearchStarted()
Notifies that a search has started.
|
SearchEngine |
getSearchEngine()
Returns the SearchEngine associated with this SearchQuery.
|
abstract boolean |
isActive()
Determines if this SearchQuery is active.
|
void |
itemsFound(boolean inSearch,
java.util.Vector docs)
Notifies that query of items is found in the search.
|
void |
removeSearchListener(SearchListener l)
Removes a listener previously added with addSearchListener.
|
void |
start(java.lang.String searchparams,
java.util.Locale l)
Starts the search.
|
void |
stop()
Stops the search.
|
protected EventListenerList listenerList
protected SearchEngine hs
protected java.lang.String searchparams
protected java.util.Locale l
public SearchQuery(SearchEngine hs)
public void addSearchListener(SearchListener l)
l
- The listener to add.java.javahelp.SearchEngine#removeSearchListener
public void removeSearchListener(SearchListener l)
l
- The listener to remove.java.javahelp.SearchEngine#addSearchListener
public void start(java.lang.String searchparams, java.util.Locale l) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
searchparams
- The search string.locale
- The locale of the search string.java.lang.IllegalArgumentException
- The parameters are not
understood by this engine.java.lang.IllegalStateException
- There is an active search in
progress in this instance.public void stop() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The search engine is not in a state in which it can be started.public SearchEngine getSearchEngine()
public abstract boolean isActive()
public void itemsFound(boolean inSearch, java.util.Vector docs)
docs
- A vector of SearchItem.inSearch
- Is the search completed?protected void fireItemsFound(boolean inSearch, java.util.Vector docs)
params
- The parameters to the search.inSearch
- Is the search completed?docs
- A vector of SearchItem.SearchItem
protected void fireItemsFound(SearchEvent e)
e
- The SearchEvent to pass through.protected void fireSearchStarted()
params
- The parameters to the search.protected void fireSearchFinished()
params
- The parameters to the search.