public abstract static class SearchListener.Wrapper extends Object implements SearchListener
Extend this and over-ride any of the interface methods to implement SearchListeners that filter hits before passing them on to an underlying listener.
You can modify the search events the delegate sees by over-riding any of the SearchListener methods, modify the arguments and then call the method on super with the new arguments. You can drop hits by just not passing them onto the delegate using super.hits(). Note: Be sure to maintain the nesting of start/stop search and hit, or you will confuse the delegate.SearchListener.Echo, SearchListener.FilterByLength, SearchListener.Tee, SearchListener.Wrapper
Constructor and Description |
---|
Wrapper(SearchListener delegate) |
Modifier and Type | Method and Description |
---|---|
void |
endSearch(String seqID)
Indicates that a sequence has been searched against a DataStore.
|
void |
hit(int hitID,
int queryOffset,
int hitOffset,
int hitLength)
There has been a hit between the query sequence and a database
sequence.
|
void |
startSearch(String seqID)
Indicates that a sequence is about to be searched against a DataStore.
|
public Wrapper(SearchListener delegate)
public void startSearch(String seqID)
SearchListener
startSearch
in interface SearchListener
seqID
- the id of the sequence to be searchedpublic void endSearch(String seqID)
SearchListener
endSearch
in interface SearchListener
seqID
- the id of the sequence to be searchedpublic void hit(int hitID, int queryOffset, int hitOffset, int hitLength)
SearchListener
hit
in interface SearchListener
hitID
- the number of the sequence hit; resolvable by
String id = DataStore.seqNameForID(hitID)queryOffset
- the offset into the query sequencehitOffset
- the offset into the sequence hit in the databasehitLength
- the number of symbols hitCopyright © 2020 BioJava. All rights reserved.