line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::YADV::Structure::Array; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
71
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
57
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
11
|
use base 'Data::YADV::Structure::Base'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1333
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub _get_child_node { |
9
|
27
|
|
|
27
|
|
40
|
my ($self, $entry) = @_; |
10
|
|
|
|
|
|
|
|
11
|
27
|
50
|
|
|
|
126
|
$self->die(qq(Wrong array index), $entry) unless $entry =~ /^\[(.+)\]$/; |
12
|
27
|
|
|
|
|
125
|
my $index = $1; |
13
|
|
|
|
|
|
|
|
14
|
27
|
|
|
|
|
168
|
my $structure = $self->get_structure; |
15
|
27
|
100
|
|
|
|
90
|
return undef unless abs($index) < scalar @$structure; |
16
|
|
|
|
|
|
|
|
17
|
26
|
|
|
|
|
140
|
$self->_build_node($entry, $structure->[$index]); |
18
|
|
|
|
|
|
|
}; |
19
|
|
|
|
|
|
|
|
20
|
4
|
|
|
4
|
0
|
150
|
sub get_size { scalar @{$_[0]->get_structure} } |
|
4
|
|
|
|
|
18
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub each { |
23
|
3
|
|
|
3
|
0
|
6
|
my ($self, $cb) = @_; |
24
|
|
|
|
|
|
|
|
25
|
3
|
|
|
|
|
10
|
my $size = $self->get_size; |
26
|
3
|
|
|
|
|
15
|
for (my $i = 0; $i < $size; ++$i) { |
27
|
6
|
|
|
|
|
71
|
$cb->($self->get_child("[$i]"), $i); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |