line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright (C) 2003-2007, G. Allen Morris III, all rights reserved |
2
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
41
|
use strict; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
6236
|
|
4
|
|
|
|
|
|
|
package |
5
|
|
|
|
|
|
|
Data::Tabular::Group::Interface; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new |
8
|
|
|
|
|
|
|
{ |
9
|
104
|
|
|
104
|
1
|
189
|
my $class = shift; |
10
|
104
|
|
|
|
|
446
|
my $self = bless { @_ }, $class; |
11
|
|
|
|
|
|
|
|
12
|
104
|
50
|
|
|
|
323
|
die 'A group field is required' unless defined $self->{group}; |
13
|
|
|
|
|
|
|
|
14
|
104
|
|
|
|
|
320
|
$self; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub get |
18
|
|
|
|
|
|
|
{ |
19
|
44
|
|
|
44
|
1
|
489
|
my $self = shift; |
20
|
44
|
|
|
|
|
61
|
my $column_name = shift; |
21
|
|
|
|
|
|
|
|
22
|
44
|
|
|
|
|
164
|
$self->{group}->get($column_name); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub count |
26
|
|
|
|
|
|
|
{ |
27
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
28
|
0
|
|
|
|
|
0
|
scalar $self->{group}->raw_rows(); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub header |
32
|
|
|
|
|
|
|
{ |
33
|
80
|
|
|
80
|
1
|
242
|
my $self = shift; |
34
|
80
|
|
|
|
|
201
|
my $args = { @_ }; |
35
|
80
|
|
|
|
|
16958
|
require Data::Tabular::Row::Header; |
36
|
80
|
|
|
|
|
419
|
Data::Tabular::Row::Header->new( |
37
|
|
|
|
|
|
|
text => $args->{text}, |
38
|
|
|
|
|
|
|
table => $self->{group}, |
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub titles |
43
|
|
|
|
|
|
|
{ |
44
|
12
|
|
|
12
|
1
|
39
|
my $self = shift; |
45
|
12
|
|
|
|
|
5112
|
require Data::Tabular::Row::Titles; |
46
|
|
|
|
|
|
|
|
47
|
12
|
|
|
|
|
136
|
Data::Tabular::Row::Titles->new( |
48
|
|
|
|
|
|
|
@_, |
49
|
|
|
|
|
|
|
table => $self->{group}, |
50
|
|
|
|
|
|
|
); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub totals |
54
|
|
|
|
|
|
|
{ |
55
|
19
|
|
|
19
|
1
|
62
|
my $self = shift; |
56
|
19
|
|
|
|
|
56
|
my $args = { @_ }; |
57
|
19
|
|
|
|
|
15296
|
require Data::Tabular::Row::Totals; |
58
|
19
|
|
66
|
|
|
134
|
my $sum_list = $args->{sum_list} || $self->{group}->{group}->{sum_list}; |
59
|
19
|
50
|
|
|
|
50
|
die('Need sum list') unless $sum_list; |
60
|
|
|
|
|
|
|
|
61
|
19
|
|
|
|
|
148
|
Data::Tabular::Row::Totals->new( |
62
|
|
|
|
|
|
|
text => $args->{title}, |
63
|
|
|
|
|
|
|
table => $self->{group}, |
64
|
|
|
|
|
|
|
sum_list => $sum_list, |
65
|
|
|
|
|
|
|
extra => $self->{group}->{group}->{extra}, |
66
|
|
|
|
|
|
|
); |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
*sum = \&totals; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub averages |
72
|
|
|
|
|
|
|
{ |
73
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
74
|
1
|
|
|
|
|
6
|
my $args = { @_ }; |
75
|
1
|
|
|
|
|
726
|
require Data::Tabular::Row::Averages; |
76
|
1
|
|
33
|
|
|
5
|
my $sum_list = $args->{sum_list} || $self->{group}->{group}->{sum_list}; |
77
|
|
|
|
|
|
|
|
78
|
1
|
|
|
|
|
14
|
Data::Tabular::Row::Averages->new( |
79
|
|
|
|
|
|
|
text => $args->{title}, |
80
|
|
|
|
|
|
|
table => $self->{group}, |
81
|
|
|
|
|
|
|
sum_list => $sum_list, |
82
|
|
|
|
|
|
|
extra => $self->{group}->{group}->{extra}, |
83
|
|
|
|
|
|
|
); |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
*avg = \&averages; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
1; |
89
|
|
|
|
|
|
|
__END__ |