line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Range::Compare::Stream::Iterator::Compare::Result; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
1241
|
use strict; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
152
|
|
4
|
6
|
|
|
6
|
|
31
|
use warnings; |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
236
|
|
5
|
|
|
|
|
|
|
use overload |
6
|
6
|
|
|
|
|
53
|
'""'=>\&to_string, |
7
|
6
|
|
|
6
|
|
29
|
fallback=>1; |
|
6
|
|
|
|
|
15
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
6
|
|
|
6
|
|
447
|
use constant COMMON_RANGE=>0; |
|
6
|
|
|
|
|
1068
|
|
|
6
|
|
|
|
|
368
|
|
11
|
6
|
|
|
6
|
|
30
|
use constant OVERLAP_RESULTS=>1; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
267
|
|
12
|
6
|
|
|
6
|
|
27
|
use constant OVERLAP_COUNT=>2; |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
302
|
|
13
|
6
|
|
|
6
|
|
30
|
use constant OVERLAP_IDS=>3; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
297
|
|
14
|
6
|
|
|
6
|
|
27
|
use constant NON_OVERLAP_IDS=>4; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
258
|
|
15
|
6
|
|
|
6
|
|
33
|
use constant COLUMN_MAP=>5; |
|
6
|
|
|
|
|
21
|
|
|
6
|
|
|
|
|
274
|
|
16
|
6
|
|
|
6
|
|
28
|
use constant ROOT_IDS=>6; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
283
|
|
17
|
|
|
|
|
|
|
|
18
|
6
|
|
|
6
|
|
31
|
use constant PRINT_FORMAT=>'Common Range: [%s] Column id(s) that Overlap: [%s]'; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
366
|
|
19
|
|
|
|
|
|
|
|
20
|
6
|
|
|
6
|
|
32
|
use base qw(Data::Range::Compare::Stream::Result::Base); |
|
6
|
|
|
|
|
7
|
|
|
6
|
|
|
|
|
5115
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub get_common_range { |
23
|
285
|
|
|
285
|
1
|
1365
|
my ($self)=@_; |
24
|
285
|
|
|
|
|
1552
|
$self->[$self->COMMON_RANGE] |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
*get_common=\&get_common_range; |
28
|
|
|
|
|
|
|
|
29
|
34
|
|
|
34
|
1
|
85
|
sub get_root_ids { [@{$_[0]->[$_[0]->ROOT_IDS]}] } |
|
34
|
|
|
|
|
183
|
|
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
0
|
1
|
0
|
sub get_column_map { [@{$_[0]->[$_[0]->COLUMN_MAP]}] } |
|
0
|
|
|
|
|
0
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub get_overlap_count { |
34
|
88
|
|
|
88
|
1
|
149
|
my ($self)=@_; |
35
|
88
|
|
|
|
|
490
|
$self->[$self->OVERLAP_COUNT] |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub get_column_count { |
39
|
108
|
|
|
108
|
1
|
165
|
my ($self)=@_; |
40
|
108
|
|
|
|
|
136
|
$#{$self->[$self->OVERLAP_RESULTS]} + 1; |
|
108
|
|
|
|
|
666
|
|
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub get_overlap_ids { |
44
|
30
|
|
|
30
|
1
|
57
|
my ($self)=@_; |
45
|
30
|
|
|
|
|
44
|
[@{$self->[$self->OVERLAP_IDS]}] |
|
30
|
|
|
|
|
260
|
|
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub get_non_overlap_ids { |
49
|
3
|
|
|
3
|
1
|
970
|
my ($self)=@_; |
50
|
3
|
|
|
|
|
6
|
[@{$self->[$self->NON_OVERLAP_IDS]}] |
|
3
|
|
|
|
|
15
|
|
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
sub get_non_overlap_count { |
53
|
3
|
|
|
3
|
1
|
9
|
$_[0]->get_column_count - $_[0]->get_overlap_count |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub get_consolidator_result_by_id { |
57
|
75
|
|
|
75
|
1
|
6072
|
my ($self,$id)=@_; |
58
|
75
|
|
|
|
|
248
|
$self->[$self->OVERLAP_RESULTS]->[$id] |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
*get_result_by_id=\&get_consolidator_result_by_id; |
62
|
|
|
|
|
|
|
*get_column_by_id=\&get_consolidator_result_by_id; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
45
|
|
|
45
|
1
|
180
|
sub is_empty { $_[0]->get_overlap_count==0 } |
66
|
|
|
|
|
|
|
*none_overlap=\&is_empty; |
67
|
|
|
|
|
|
|
|
68
|
22
|
|
|
22
|
1
|
85
|
sub is_full { $_[0]->get_overlap_count==$_[0]->get_column_count } |
69
|
|
|
|
|
|
|
*all_overlap=\&is_full; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub get_overlapping_containers { |
73
|
2
|
|
|
2
|
1
|
1741
|
my ($self)=@_; |
74
|
2
|
|
|
|
|
4
|
[@{$self->[$self->OVERLAP_RESULTS]}[@{$self->get_overlap_ids}]] |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
7
|
|
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub get_all_containers { |
79
|
4
|
|
|
4
|
1
|
9
|
my ($self)=@_; |
80
|
4
|
|
|
|
|
8
|
[@{$self->[$self->OVERLAP_RESULTS]}] |
|
4
|
|
|
|
|
31
|
|
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub get_non_overlapping_containers { |
84
|
0
|
|
|
0
|
1
|
0
|
my ($self)=@_; |
85
|
0
|
|
|
|
|
0
|
[@{$self->[$self->OVERLAP_RESULTS]}[@{$self->get_non_overlap_ids}]] |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub to_string { |
89
|
0
|
|
|
0
|
1
|
0
|
my ($self)=@_; |
90
|
0
|
|
|
|
|
0
|
return sprintf $self->PRINT_FORMAT,$self->get_common,join(',',@{$self->get_overlap_ids}); |
|
0
|
|
|
|
|
0
|
|
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub get_root_result_ids { |
94
|
10
|
|
|
10
|
1
|
16
|
my ($self)=@_; |
95
|
|
|
|
|
|
|
|
96
|
10
|
|
|
|
|
17
|
my $result=[]; |
97
|
|
|
|
|
|
|
|
98
|
10
|
|
|
|
|
30
|
my $map=$self->[$self->COLUMN_MAP]; |
99
|
|
|
|
|
|
|
|
100
|
10
|
|
|
|
|
25
|
for(my $id=0;$id<$self->get_column_count;++$id ) { |
101
|
28
|
|
|
|
|
42
|
my $target=$map->[$id]; |
102
|
28
|
100
|
|
|
|
63
|
$result->[$target]=[] unless defined($result->[$target]); |
103
|
|
|
|
|
|
|
|
104
|
28
|
|
|
|
|
39
|
my $ref=$result->[$target]; |
105
|
28
|
|
|
|
|
79
|
my $obj=$self->get_result_by_id($id); |
106
|
|
|
|
|
|
|
|
107
|
28
|
100
|
|
|
|
110
|
push @$ref,$id if defined($obj); |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
10
|
|
|
|
|
36
|
return $result; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub get_root_results { |
114
|
10
|
|
|
10
|
1
|
38
|
my ($self)=@_; |
115
|
|
|
|
|
|
|
|
116
|
10
|
|
|
|
|
15
|
my $result=[]; |
117
|
|
|
|
|
|
|
|
118
|
10
|
|
|
|
|
24
|
my $map=$self->[$self->COLUMN_MAP]; |
119
|
|
|
|
|
|
|
|
120
|
10
|
|
|
|
|
22
|
for(my $id=0;$id<$self->get_column_count;++$id ) { |
121
|
28
|
|
|
|
|
41
|
my $target=$map->[$id]; |
122
|
28
|
100
|
|
|
|
64
|
$result->[$target]=[] unless defined($result->[$target]); |
123
|
|
|
|
|
|
|
|
124
|
28
|
|
|
|
|
37
|
my $ref=$result->[$target]; |
125
|
28
|
|
|
|
|
57
|
my $obj=$self->get_result_by_id($id); |
126
|
28
|
100
|
|
|
|
80
|
next unless defined($obj); |
127
|
|
|
|
|
|
|
|
128
|
17
|
|
|
|
|
53
|
push @$ref,$obj; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
10
|
|
|
|
|
26
|
return $result; |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
1; |