/*
* BioJava development code
*
* This code may be freely distributed and modified under the
* terms of the GNU Lesser General Public Licence. This should
* be distributed with the code. If you do not have a copy,
* see:
*
* http://www.gnu.org/copyleft/lesser.html
*
* Copyright for this code is held jointly by the individual
* authors. These should be listed in @author doc comments.
*
* For more information on the BioJava project and its aims,
* or to join the biojava-l mailing list, visit the home page
* at:
*
* http://www.biojava.org/
*
*/
package org.biojava.bio.search;
/**
* SearchContentHandler
is a notification interface for
* objects which listen to search stream parsers. This is applicable
* to all types of search results which are represented by flat files
* created by external programs e.g. Fasta, (T)BlastN/PX, EMBOSS
* programs. This is not limited to sequence similarity searches, but
* includes any format consisting of a header followed by hits, each
* of which may, or may not, have subhits.
*
* @author Keith James
* @since 1.1
*/
public interface SearchContentHandler
{
/**
* getMoreSearches
returns the state of the
* SearchContentHandler
with respect to further
* searches from its data source. Used for handling streams of
* search results.
*
* @return a boolean
value.
*/
public boolean getMoreSearches();
/**
* setMoreSearches
sets the state of the
* SearchContentHandler
's expectation of receiving
* more results. Used for handling streams of search results.
*
* @param value a boolean
value.
*/
public void setMoreSearches(boolean value);
/**
* The startSearch
method indicates the start of
* useful search information.
*/
public void startSearch();
/**
* The endSearch
method indicates the end of useful
* search information.
*/
public void endSearch();
/**
* The startHeader
method indicates the start of a
* formatted header. This usually contains information relevant to
* the search as a whole.
*/
public void startHeader();
/**
* The endHeader
method indicates the end of a
* formatted header.
*/
public void endHeader();
/**
* The startHit
method indicates the start of a
* formatted hit. This could be a single line, or a block of
* lines.
*/
public void startHit();
/**
* The endHit
method indicates the end of a formatted
* hit.
*/
public void endHit();
/**
* The startSubHit
method indicates the start of a
* formatted subhit. There may be zero or more of these per hit.
*/
public void startSubHit();
/**
* The endSubHit
method indicates the end of a
* formatted subhit.
*/
public void endSubHit();
/**
* The addSearchProperty
method adds a key/value pair
* containing some property of the overall search result.
*
* @param key an Object
.
* @param value an Object
.
*/
public void addSearchProperty(Object key, Object value);
/**
* The addHitProperty
method adds a key/value pair
* containing some property of a particular hit.
*
* @param key an Object
.
* @param value an Object
.
*/
public void addHitProperty(Object key, Object value);
/**
* The addSubHitProperty
method adds a key/value pair
* containing some property of a particular subhit.
*
* @param key an Object
.
* @param value an Object
.
*/
public void addSubHitProperty(Object key, Object value);
/**
* setQueryID
identifies the query sequence by a
* name, ID or URN.
*
* @param queryID a String
which should be an unique
* identifer for the sequence.
*/
public void setQueryID(String queryID);
/**
* setDatabaseID
identifies the database searched by
* a name, ID or URN.
*
* @param databaseID a String
which should be an unique
* identifier for the database searched.
*/
public void setDatabaseID(String databaseID);
}