FAST/Bio/Search/GenericStatistics.pm untested

filter: Statementstmt 0.0% 0 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 26 SCAR 6.9
CC
1
Cov
0%
new
2.0
get_statistic
2.0
set_statistic
2.0
CRAP 2.0
1 #
2 #
3 # BioPerl module for wrapping statistics
4 #
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 #
7 # Cared for by Chad Matsalla (bioinformatics1 at dieselwurks dot com)
8 #
9 # Copyright Chad Matsalla
10 #
11 # You may distribute this module under the same terms as perl itself
12  
13 # POD documentation - main docs before the code
14  
15 =head1 NAME
16  
17 FAST::Bio::Search::GenericStatistics - An object for statistics
18  
19 =head1 SYNOPSIS
20  
21 my $void = $obj->set_statistic("statistic_name","statistic_value");
22 my $value = $obj->get_statistic("statistic_name");
23  
24 =head1 DESCRIPTION
25  
26 This is a basic container to hold the statistics returned from a program.
27  
28 =head1 FEEDBACK
29  
30 =head2 Mailing Lists
31  
32 User feedback is an integral part of the evolution of this and other
33 Bioperl modules. Send your comments and suggestions preferably to
34 the Bioperl mailing list. Your participation is much appreciated.
35  
36 bioperl-l@bioperl.org - General discussion
37 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
38  
39 =head2 Support
40  
41 Please direct usage questions or support issues to the mailing list:
42  
43 I<bioperl-l@bioperl.org>
44  
45 rather than to the module maintainer directly. Many experienced and
46 reponsive experts will be able look at the problem and quickly
47 address it. Please include a thorough description of the problem
48 with code and data examples if at all possible.
49  
50 =head2 Reporting Bugs
51  
52 Report bugs to the Bioperl bug tracking system to help us keep track
53 of the bugs and their resolution. Bug reports can be submitted via the
54 web:
55  
56 https://redmine.open-bio.org/projects/bioperl/
57  
58 =head1 AUTHOR - Chad Matsalla
59  
60 Email bioinformatics1 at dieselwurks dot com
61  
62 =head1 CONTRIBUTORS
63  
64 Sendu Bala, bix@sendu.me.uk
65  
66 =head1 APPENDIX
67  
68 The rest of the documentation details each of the object methods.
69 Internal methods are usually preceded with a _
70  
71 =cut
72  
73 # Let the code begin...
74  
75 package FAST::Bio::Search::GenericStatistics;
76 use strict;
77  
78  
79 use base qw(FAST::Bio::Root::Root FAST::Bio::Search::StatisticsI);
80  
81 sub new {
82 my ($class, @args) = @_;
83 my $self = $class->SUPER::new(@args);
84 return $self;
85 }
86  
87 =head2 get_statistic
88  
89 Title : get_statistic
90 Usage : $statistic_object->get_statistic($statistic_name);
91 Function: Get the value of a statistic named $statistic_name
92 Returns : A scalar that should be a string
93 Args : A scalar that should be a string
94  
95 =cut
96  
97 sub get_statistic {
98 my ($self,$arg) = @_;
99 return $self->{stats}->{$arg};
100 }
101  
102 =head2 set_statistic
103  
104 Title : set_statistic
105 Usage : $statistic_object->set_statistic($statistic_name => $statistic_value);
106 Function: Set the value of a statistic named $statistic_name to $statistic_value
107 Returns : Void
108 Args : A hash containing name=>value pairs
109  
110 =cut
111  
112 sub set_statistic {
113 my ($self,$name,$value) = @_;
114 $self->{stats}->{$name} = $value;
115 }
116  
117 =head2 available_statistics
118  
119 Title : available_statistics
120 Usage : my @statnames = $statistic_object->available_statistics
121 Function: Returns the names of the available statistics
122 Returns : list of available statistic names
123 Args : none
124  
125 =cut
126  
127 sub available_statistics {
128 my $self = shift;
129 return keys %{$self->{stats}};
130 }
131  
132 1;