line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::TableContent::Table::Header; |
2
|
|
|
|
|
|
|
|
3
|
20
|
|
|
20
|
|
85
|
use Moo; |
|
20
|
|
|
|
|
23
|
|
|
20
|
|
|
|
|
94
|
|
4
|
20
|
|
|
20
|
|
11082
|
use HTML::TableContent::Table::Row::Cell; |
|
20
|
|
|
|
|
32
|
|
|
20
|
|
|
|
|
4701
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.17'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
extends 'HTML::TableContent::Element'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has 'cells' => ( |
11
|
|
|
|
|
|
|
is => 'rw', |
12
|
|
|
|
|
|
|
lazy => 1, |
13
|
|
|
|
|
|
|
default => sub { [] }, |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has '+html_tag' => ( |
17
|
|
|
|
|
|
|
default => 'th', |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub add_cell { |
21
|
0
|
|
|
0
|
0
|
0
|
my $cell = HTML::TableContent::Table::Row::Cell->new($_[1]); |
22
|
0
|
|
|
|
|
0
|
push @{ $_[0]->cells }, $cell; |
|
0
|
|
|
|
|
0
|
|
23
|
0
|
|
|
|
|
0
|
return $cell; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
23
|
|
|
23
|
0
|
433
|
sub cell_count { return scalar @{ $_[0]->cells }; } |
|
23
|
|
|
|
|
416
|
|
27
|
|
|
|
|
|
|
|
28
|
67
|
|
|
67
|
1
|
52
|
sub all_cells { return @{ $_[0]->cells }; } |
|
67
|
|
|
|
|
881
|
|
29
|
|
|
|
|
|
|
|
30
|
56
|
|
|
56
|
1
|
772
|
sub get_cell { return $_[0]->cells->[ $_[1] ]; } |
31
|
|
|
|
|
|
|
|
32
|
56
|
|
|
56
|
1
|
2398
|
sub get_first_cell { return $_[0]->get_cell(0); } |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
0
|
1
|
|
sub get_last_cell { return $_[0]->get_cell( $_[0]->cell_count - 1 ); } |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub unique_cells { |
37
|
0
|
|
|
0
|
0
|
|
my $count_cells = { }; |
38
|
0
|
|
|
|
|
|
map { $count_cells->{$_->text}++ } $_[0]->all_cells; |
|
0
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
return $count_cells; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |