Bio::Search::Result ResultFactory
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::Search::Result::ResultFactory - A factory to create Bio::Search::Result::ResultI objects
Package variables
No package variables defined.
Included modules
Bio::Factory::ObjectFactoryI
Bio::Root::Root
Inherit
Bio::Factory::ObjectFactoryI Bio::Root::Root
Synopsis
    use Bio::Search::Result::ResultFactory;
my $factory = new Bio::Search::Result::ResultFactory();
my $resultobj = $factory->create(@args);
Description
This is a general way of hiding the object creation process so that we
can dynamically change the objects that are created by the SearchIO
parser depending on what format report we are parsing.
This object is for creating new Results.
Methods
BEGIN Code
createDescriptionCode
newDescriptionCode
typeDescriptionCode
Methods description
createcode    nextTop
 Title   : create
Usage : $factory->create(%args)
Function: Create a new Bio::Search::Result::ResultI object
Returns : Bio::Search::Result::ResultI
Args : hash of initialization parameters
newcodeprevnextTop
 Title   : new
Usage : my $obj = new Bio::Search::Result::ResultFactory();
Function: Builds a new Bio::Search::Result::ResultFactory object
Returns : Bio::Search::Result::ResultFactory
Args :
typecodeprevnextTop
 Title   : type
Usage : $factory->type('Bio::Search::Result::GenericResult');
Function: Get/Set the Result creation type
Returns : string
Args : [optional] string to set
Methods code
BEGINTop
BEGIN {
     $DEFAULT_TYPE = 'Bio::Search::Result::GenericResult';
}
createdescriptionprevnextTop
sub create {
   my ($self,@args) = @_;
   my $type = $self->type;
   eval { $self->_load_module($type) };
   if( $@ ) { $self->throw("Unable to load module $type: $@"); }
   return $type->new(@args);
}
newdescriptionprevnextTop
sub new {
  my($class,@args) = @_;

  my $self = $class->SUPER::new(@args);
  my ($type) = $self->_rearrange([qw(TYPE)],@args);
  $self->type($type) if defined $type;
  return $self;
}
typedescriptionprevnextTop
sub type {
    my ($self,$type) = @_;
   if( defined $type ) { 
       # redundancy with the create method which also calls _load_module
# I know - but this is not a highly called object so I am going
# to leave it in
eval {$self->_load_module($type) }; if( $@ ){ $self->warn("Cannot find module $type, unable to set type"); } else { $self->{'_type'} = $type; } } return $self->{'_type'} || $DEFAULT_TYPE; } 1;
}
General documentation
FEEDBACKTop
Mailing ListsTop
User feedback is an integral part of the evolution of this and other
Bioperl modules. Send your comments and suggestions preferably to
the Bioperl mailing list. Your participation is much appreciated.
  bioperl-l@bioperl.org              - General discussion
http://bioperl.org/MailList.shtml - About the mailing lists
Reporting BugsTop
Report bugs to the Bioperl bug tracking system to help us keep track
of the bugs and their resolution. Bug reports can be submitted via
email or the web:
  bioperl-bugs@bioperl.org
http://bugzilla.bioperl.org/
AUTHOR - Jason StajichTop
Email jason@bioperl.org
Describe contact details here
CONTRIBUTORSTop
Additional contributors names and emails here
APPENDIXTop
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _