3 # BioPerl module for Bio::SearchIO::EventHandlerI
5 # Cared for by Jason Stajich <jason@bioperl.org>
7 # Copyright Jason Stajich
9 # You may distribute this module under the same terms as perl itself
11 # POD documentation - main docs before the code
15 Bio::SearchIO::EventHandlerI - An abstract Event Handler for Search Result parsing
19 # do not use this object directly it is an interface
20 # See Bio::SearchIO::SearchResultEventBuilder for an implementation
22 use Bio::SearchIO::SearchResultEventBuilder;
23 my $handler = Bio::SearchIO::SearchResultEventBuilder->new();
27 This interface describes the basic methods needed to handle Events
28 thrown from parsing a Search Result such as FASTA, BLAST, or HMMer.
34 User feedback is an integral part of the evolution of this and other
35 Bioperl modules. Send your comments and suggestions preferably to
36 the Bioperl mailing list. Your participation is much appreciated.
38 bioperl-l@bioperl.org - General discussion
39 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
43 Report bugs to the Bioperl bug tracking system to help us keep track
44 of the bugs and their resolution. Bug reports can be submitted via the
47 http://bugzilla.open-bio.org/
49 =head1 AUTHOR - Jason Stajich
51 Email jason-at-bioperl.org
55 The rest of the documentation details each of the object methods.
56 Internal methods are usually preceded with a _
61 # Let the code begin...
64 package Bio
::SearchIO
::EventHandlerI
;
69 use base
qw(Bio::Event::EventHandlerI);
74 Usage : $handler->start_result($data)
75 Function: Begins a result event cycle
83 $self->throw_not_implemented();
89 Usage : $handler->end_result($data)
90 Function: Ends a result event cycle
91 Returns : Bio::Search::Result::ResultI object
98 my ($self,@args) = @_;
99 $self->throw_not_implemented();
105 Usage : $handler->start_hsp($data)
106 Function: Start a HSP event cycle
108 Args : type of element
114 my ($self,@args) = @_;
115 $self->throw_not_implemented();
121 Usage : $handler->end_hsp()
122 Function: Ends a HSP event cycle
123 Returns : Bio::Search::HSP::HSPI object
124 Args : type of event and associated hashref
129 my ($self,@args) = @_;
130 $self->throw_not_implemented();
136 Usage : $handler->start_hit()
137 Function: Starts a Hit event cycle
139 Args : type of event and associated hashref
145 my ($self,@args) = @_;
146 $self->throw_not_implemented
152 Usage : $handler->end_hit()
153 Function: Ends a Hit event cycle
154 Returns : Bio::Search::Hit::HitI object
155 Args : type of event and associated hashref
161 my ($self,@args) = @_;
162 $self->throw_not_implemented();
165 =head2 start_iteration
167 Title : start_iteration
168 Usage : $handler->start_iteration()
169 Function: Starts an Iteration event cycle
171 Args : type of event and associated hashref
176 sub start_iteration
{
177 my ($self,@args) = @_;
178 $self->throw_not_implemented
183 Title : end_iteration
184 Usage : $handler->end_iteration()
185 Function: Ends an Iterationevent cycle
186 Returns : Bio::Search::Iteration::IterationI object
187 Args : type of event and associated hashref
193 my ($self,@args) = @_;
194 $self->throw_not_implemented();
197 =head2 register_factory
199 Title : register_factory
200 Usage : $handler->register_factory('TYPE',$factory);
201 Function: Register a specific factory for a object type class
203 Args : string representing the class and
204 Bio::Factory::ObjectFactoryI
206 See L<Bio::Factory::ObjectFactoryI> for more information
210 sub register_factory
{
211 my ($self,@args) = @_;
212 $self->throw_not_implemented();
219 Usage : my $f = $handler->factory('TYPE');
220 Function: Retrieves the associated factory for requested 'TYPE'
221 Returns : a Bio::Factory::ObjectFactoryI
222 Throws : Bio::Root::BadParameter if none registered for the supplied type
223 Args : name of factory class to retrieve
225 See L<Bio::Factory::ObjectFactoryI> for more information
230 my ($self,@args) = @_;
231 $self->throw_not_implemented();
235 =head2 Bio::Event::EventHandlerI methods
242 Usage : if( $handler->will_handle($event_type) ) { ... }
243 Function: Tests if this event builder knows how to process a specific event
245 Args : event type name
252 See L<Bio::Event::EventHandlerI> for the additional SAX methods.