Package org.biojava.bio.search
Class SearchContentHandlerDebugger
java.lang.Object
org.biojava.bio.search.SearchContentHandlerDebugger
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionCreate an instance that dumps to System.out.SearchContentHandlerDebugger
(PrintStream pStream) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addHitProperty
(Object key, Object value) TheaddHitProperty
method adds a key/value pair containing some property of a particular hit.void
addSearchProperty
(Object key, Object value) TheaddSearchProperty
method adds a key/value pair containing some property of the overall search result.void
addSubHitProperty
(Object key, Object value) TheaddSubHitProperty
method adds a key/value pair containing some property of a particular subhit.void
TheendHeader
method indicates the end of a formatted header.void
endHit()
TheendHit
method indicates the end of a formatted hit.void
TheendSearch
method indicates the end of useful search information.void
TheendSubHit
method indicates the end of a formatted subhit.boolean
getMoreSearches
returns the state of theSearchContentHandler
with respect to further searches from its data source.void
setDatabaseID
(String databaseID) setDatabaseID
identifies the database searched by a name, ID or URN.void
setMoreSearches
(boolean value) setMoreSearches
sets the state of theSearchContentHandler
's expectation of receiving more results.void
setQueryID
(String queryID) setQueryID
identifies the query sequence by a name, ID or URN.void
ThestartHeader
method indicates the start of a formatted header.void
startHit()
ThestartHit
method indicates the start of a formatted hit.void
ThestartSearch
method indicates the start of useful search information.void
ThestartSubHit
method indicates the start of a formatted subhit.
-
Constructor Details
-
SearchContentHandlerDebugger
public SearchContentHandlerDebugger()Create an instance that dumps to System.out. -
SearchContentHandlerDebugger
- Parameters:
pStream
- Stream to dump output to.
-
-
Method Details
-
addHitProperty
Description copied from interface:SearchContentHandler
TheaddHitProperty
method adds a key/value pair containing some property of a particular hit.- Specified by:
addHitProperty
in interfaceSearchContentHandler
- Parameters:
key
- anObject
.value
- anObject
.
-
addSubHitProperty
Description copied from interface:SearchContentHandler
TheaddSubHitProperty
method adds a key/value pair containing some property of a particular subhit.- Specified by:
addSubHitProperty
in interfaceSearchContentHandler
- Parameters:
key
- anObject
.value
- anObject
.
-
addSearchProperty
Description copied from interface:SearchContentHandler
TheaddSearchProperty
method adds a key/value pair containing some property of the overall search result.- Specified by:
addSearchProperty
in interfaceSearchContentHandler
- Parameters:
key
- anObject
.value
- anObject
.
-
setMoreSearches
Description copied from interface:SearchContentHandler
setMoreSearches
sets the state of theSearchContentHandler
's expectation of receiving more results. Used for handling streams of search results.- Specified by:
setMoreSearches
in interfaceSearchContentHandler
- Parameters:
value
- aboolean
value.
-
getMoreSearches
Description copied from interface:SearchContentHandler
getMoreSearches
returns the state of theSearchContentHandler
with respect to further searches from its data source. Used for handling streams of search results.- Specified by:
getMoreSearches
in interfaceSearchContentHandler
- Returns:
- a
boolean
value.
-
endHeader
Description copied from interface:SearchContentHandler
TheendHeader
method indicates the end of a formatted header.- Specified by:
endHeader
in interfaceSearchContentHandler
-
endHit
Description copied from interface:SearchContentHandler
TheendHit
method indicates the end of a formatted hit.- Specified by:
endHit
in interfaceSearchContentHandler
-
endSearch
Description copied from interface:SearchContentHandler
TheendSearch
method indicates the end of useful search information.- Specified by:
endSearch
in interfaceSearchContentHandler
-
endSubHit
Description copied from interface:SearchContentHandler
TheendSubHit
method indicates the end of a formatted subhit.- Specified by:
endSubHit
in interfaceSearchContentHandler
-
setDatabaseID
Description copied from interface:SearchContentHandler
setDatabaseID
identifies the database searched by a name, ID or URN.- Specified by:
setDatabaseID
in interfaceSearchContentHandler
- Parameters:
databaseID
- aString
which should be an unique identifier for the database searched.
-
setQueryID
Description copied from interface:SearchContentHandler
setQueryID
identifies the query sequence by a name, ID or URN.- Specified by:
setQueryID
in interfaceSearchContentHandler
- Parameters:
queryID
- aString
which should be an unique identifer for the sequence.
-
startHeader
Description copied from interface:SearchContentHandler
ThestartHeader
method indicates the start of a formatted header. This usually contains information relevant to the search as a whole.- Specified by:
startHeader
in interfaceSearchContentHandler
-
startHit
Description copied from interface:SearchContentHandler
ThestartHit
method indicates the start of a formatted hit. This could be a single line, or a block of lines.- Specified by:
startHit
in interfaceSearchContentHandler
-
startSearch
Description copied from interface:SearchContentHandler
ThestartSearch
method indicates the start of useful search information.- Specified by:
startSearch
in interfaceSearchContentHandler
-
startSubHit
Description copied from interface:SearchContentHandler
ThestartSubHit
method indicates the start of a formatted subhit. There may be zero or more of these per hit.- Specified by:
startSubHit
in interfaceSearchContentHandler
-