SearchContentHandlerDebugger (biojava-legacy 1.9.5 API)
- java.lang.Object
-
- org.biojava.bio.search.SearchContentHandlerDebugger
-
- All Implemented Interfaces:
SearchContentHandler
public class SearchContentHandlerDebugger extends Object implements SearchContentHandler
This class prints to a PrintStream calls to the SearchContentHandler interface in human readable form. Use to debug parser/adaptor classes that output to the SearchContentHandler interface.
- Author:
- David Huen
-
-
Constructor Summary
Constructors Constructor Description SearchContentHandlerDebugger()Create an instance that dumps to System.out.
SearchContentHandlerDebugger(PrintStream pStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHitProperty(Object key, Object value)The
addHitPropertymethod adds a key/value pair containing some property of a particular hit.voidaddSearchProperty(Object key, Object value)The
addSearchPropertymethod adds a key/value pair containing some property of the overall search result.voidaddSubHitProperty(Object key, Object value)The
addSubHitPropertymethod adds a key/value pair containing some property of a particular subhit.voidendHeader()The
endHeadermethod indicates the end of a formatted header.voidendHit()The
endHitmethod indicates the end of a formatted hit.voidendSearch()The
endSearchmethod indicates the end of useful search information.voidendSubHit()The
endSubHitmethod indicates the end of a formatted subhit.booleangetMoreSearches()getMoreSearchesreturns the state of theSearchContentHandlerwith respect to further searches from its data source.voidsetDatabaseID(String databaseID)setDatabaseIDidentifies the database searched by a name, ID or URN.voidsetMoreSearches(boolean value)setMoreSearchessets the state of theSearchContentHandler's expectation of receiving more results.voidsetQueryID(String queryID)setQueryIDidentifies the query sequence by a name, ID or URN.voidstartHeader()The
startHeadermethod indicates the start of a formatted header.voidstartHit()The
startHitmethod indicates the start of a formatted hit.voidstartSearch()The
startSearchmethod indicates the start of useful search information.voidstartSubHit()The
startSubHitmethod indicates the start of a formatted subhit.
-
-
-
Constructor Detail
-
SearchContentHandlerDebugger
public SearchContentHandlerDebugger()
Create an instance that dumps to System.out.
-
SearchContentHandlerDebugger
public SearchContentHandlerDebugger(PrintStream pStream)
- Parameters:
pStream- Stream to dump output to.
-
-
Method Detail
-
addHitProperty
public void addHitProperty(Object key, Object value)
The
addHitPropertymethod adds a key/value pair containing some property of a particular hit.- Specified by:
addHitPropertyin interfaceSearchContentHandler- Parameters:
key- anObject.value- anObject.
-
addSubHitProperty
public void addSubHitProperty(Object key, Object value)
The
addSubHitPropertymethod adds a key/value pair containing some property of a particular subhit.- Specified by:
addSubHitPropertyin interfaceSearchContentHandler- Parameters:
key- anObject.value- anObject.
-
addSearchProperty
public void addSearchProperty(Object key, Object value)
The
addSearchPropertymethod adds a key/value pair containing some property of the overall search result.- Specified by:
addSearchPropertyin interfaceSearchContentHandler- Parameters:
key- anObject.value- anObject.
-
setMoreSearches
public void setMoreSearches(boolean value)
setMoreSearchessets the state of theSearchContentHandler's expectation of receiving more results. Used for handling streams of search results.- Specified by:
setMoreSearchesin interfaceSearchContentHandler- Parameters:
value- abooleanvalue.
-
getMoreSearches
public boolean getMoreSearches()
getMoreSearchesreturns the state of theSearchContentHandlerwith respect to further searches from its data source. Used for handling streams of search results.- Specified by:
getMoreSearchesin interfaceSearchContentHandler- Returns:
- a
booleanvalue.
-
endHeader
public void endHeader()
The
endHeadermethod indicates the end of a formatted header.- Specified by:
endHeaderin interfaceSearchContentHandler
-
endHit
public void endHit()
The
endHitmethod indicates the end of a formatted hit.- Specified by:
endHitin interfaceSearchContentHandler
-
endSearch
public void endSearch()
The
endSearchmethod indicates the end of useful search information.- Specified by:
endSearchin interfaceSearchContentHandler
-
endSubHit
public void endSubHit()
The
endSubHitmethod indicates the end of a formatted subhit.- Specified by:
endSubHitin interfaceSearchContentHandler
-
setDatabaseID
public void setDatabaseID(String databaseID)
setDatabaseIDidentifies the database searched by a name, ID or URN.- Specified by:
setDatabaseIDin interfaceSearchContentHandler- Parameters:
databaseID- aStringwhich should be an unique identifier for the database searched.
-
setQueryID
public void setQueryID(String queryID)
setQueryIDidentifies the query sequence by a name, ID or URN.- Specified by:
setQueryIDin interfaceSearchContentHandler- Parameters:
queryID- aStringwhich should be an unique identifer for the sequence.
-
startHeader
public void startHeader()
The
startHeadermethod indicates the start of a formatted header. This usually contains information relevant to the search as a whole.- Specified by:
startHeaderin interfaceSearchContentHandler
-
startHit
public void startHit()
The
startHitmethod indicates the start of a formatted hit. This could be a single line, or a block of lines.- Specified by:
startHitin interfaceSearchContentHandler
-
startSearch
public void startSearch()
The
startSearchmethod indicates the start of useful search information.- Specified by:
startSearchin interfaceSearchContentHandler
-
startSubHit
public void startSubHit()
The
startSubHitmethod indicates the start of a formatted subhit. There may be zero or more of these per hit.- Specified by:
startSubHitin interfaceSearchContentHandler
-
-