3 # BioPerl module for wrapping statistics
5 # Cared for by Chad Matsalla (bioinformatics1 at dieselwurks dot com)
7 # Copyright Chad Matsalla
9 # You may distribute this module under the same terms as perl itself
11 # POD documentation - main docs before the code
15 Bio::Search::GenericStatistics - An object for statistics
19 my $void = $obj->set_statistic("statistic_name","statistic_value");
20 my $value = $obj->get_statistic("statistic_name");
24 This is a basic container to hold the statistics returned from a program.
30 User feedback is an integral part of the evolution of this and other
31 Bioperl modules. Send your comments and suggestions preferably to
32 the Bioperl mailing list. Your participation is much appreciated.
34 bioperl-l@bioperl.org - General discussion
35 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
39 Report bugs to the Bioperl bug tracking system to help us keep track
40 of the bugs and their resolution. Bug reports can be submitted via the
43 http://bugzilla.open-bio.org/
45 =head1 AUTHOR - Chad Matsalla
47 Email bioinformatics1 at dieselwurks dot com
51 Sendu Bala, bix@sendu.me.uk
55 The rest of the documentation details each of the object methods.
56 Internal methods are usually preceded with a _
60 # Let the code begin...
62 package Bio
::Search
::GenericStatistics
;
66 use base
qw(Bio::Root::Root Bio::Search::StatisticsI);
69 my ($class, @args) = @_;
70 my $self = $class->SUPER::new
(@args);
77 Usage : $statistic_object->get_statistic($statistic_name);
78 Function: Get the value of a statistic named $statistic_name
79 Returns : A scalar that should be a string
80 Args : A scalar that should be a string
86 return $self->{stats
}->{$arg};
92 Usage : $statistic_object->set_statistic($statistic_name => $statistic_value);
93 Function: Set the value of a statistic named $statistic_name to $statistic_value
95 Args : A hash containing name=>value pairs
100 my ($self,$name,$value) = @_;
101 $self->{stats
}->{$name} = $value;
104 =head2 available_statistics
106 Title : available_statistics
107 Usage : my @statnames = $statistic_object->available_statistics
108 Function: Returns the names of the available statistics
109 Returns : list of available statistic names
114 sub available_statistics
{
116 return keys %{$self->{stats
}};