line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Range::Compare::Stream::Iterator::Compare::Result; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
1074
|
use strict; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
209
|
|
4
|
6
|
|
|
6
|
|
29
|
use warnings; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
9275
|
|
5
|
|
|
|
|
|
|
use overload |
6
|
6
|
|
|
|
|
403
|
'""'=>\&to_string, |
7
|
6
|
|
|
6
|
|
148
|
fallback=>1; |
|
6
|
|
|
|
|
11
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
6
|
|
|
6
|
|
1439
|
use constant COMMON_RANGE=>0; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
648
|
|
11
|
6
|
|
|
6
|
|
40
|
use constant OVERLAP_RESULTS=>1; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
1373
|
|
12
|
6
|
|
|
6
|
|
33
|
use constant OVERLAP_COUNT=>2; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
793
|
|
13
|
6
|
|
|
6
|
|
118
|
use constant OVERLAP_IDS=>3; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
477
|
|
14
|
6
|
|
|
6
|
|
29
|
use constant NON_OVERLAP_IDS=>4; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
448
|
|
15
|
6
|
|
|
6
|
|
340
|
use constant COLUMN_MAP=>5; |
|
6
|
|
|
|
|
38
|
|
|
6
|
|
|
|
|
345
|
|
16
|
6
|
|
|
6
|
|
28
|
use constant ROOT_IDS=>6; |
|
6
|
|
|
|
|
21
|
|
|
6
|
|
|
|
|
431
|
|
17
|
|
|
|
|
|
|
|
18
|
6
|
|
|
6
|
|
162
|
use constant PRINT_FORMAT=>'Common Range: [%s] Column id(s) that Overlap: [%s]'; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
330
|
|
19
|
|
|
|
|
|
|
|
20
|
6
|
|
|
6
|
|
32
|
use base qw(Data::Range::Compare::Stream::Result::Base); |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
7200
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub get_common_range { |
23
|
285
|
|
|
285
|
1
|
1672
|
my ($self)=@_; |
24
|
285
|
|
|
|
|
2381
|
$self->[$self->COMMON_RANGE] |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
*get_common=\&get_common_range; |
28
|
|
|
|
|
|
|
|
29
|
34
|
|
|
34
|
1
|
82
|
sub get_root_ids { [@{$_[0]->[$_[0]->ROOT_IDS]}] } |
|
34
|
|
|
|
|
222
|
|
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
|
160
|
my ($self)=@_; |
35
|
88
|
|
|
|
|
533
|
$self->[$self->OVERLAP_COUNT] |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub get_column_count { |
39
|
108
|
|
|
108
|
1
|
161
|
my ($self)=@_; |
40
|
108
|
|
|
|
|
279
|
$#{$self->[$self->OVERLAP_RESULTS]} + 1; |
|
108
|
|
|
|
|
750
|
|
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub get_overlap_ids { |
44
|
30
|
|
|
30
|
1
|
76
|
my ($self)=@_; |
45
|
30
|
|
|
|
|
49
|
[@{$self->[$self->OVERLAP_IDS]}] |
|
30
|
|
|
|
|
340
|
|
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub get_non_overlap_ids { |
49
|
3
|
|
|
3
|
1
|
665
|
my ($self)=@_; |
50
|
3
|
|
|
|
|
5
|
[@{$self->[$self->NON_OVERLAP_IDS]}] |
|
3
|
|
|
|
|
15
|
|
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
sub get_non_overlap_count { |
53
|
3
|
|
|
3
|
1
|
11
|
$_[0]->get_column_count - $_[0]->get_overlap_count |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub get_consolidator_result_by_id { |
57
|
75
|
|
|
75
|
1
|
3805
|
my ($self,$id)=@_; |
58
|
75
|
|
|
|
|
672
|
$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
|
206
|
sub is_empty { $_[0]->get_overlap_count==0 } |
66
|
|
|
|
|
|
|
*none_overlap=\&is_empty; |
67
|
|
|
|
|
|
|
|
68
|
22
|
|
|
22
|
1
|
261
|
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
|
2488
|
my ($self)=@_; |
74
|
2
|
|
|
|
|
6
|
[@{$self->[$self->OVERLAP_RESULTS]}[@{$self->get_overlap_ids}]] |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
8
|
|
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub get_all_containers { |
79
|
4
|
|
|
4
|
1
|
12
|
my ($self)=@_; |
80
|
4
|
|
|
|
|
7
|
[@{$self->[$self->OVERLAP_RESULTS]}] |
|
4
|
|
|
|
|
34
|
|
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
|
18
|
my ($self)=@_; |
95
|
|
|
|
|
|
|
|
96
|
10
|
|
|
|
|
15
|
my $result=[]; |
97
|
|
|
|
|
|
|
|
98
|
10
|
|
|
|
|
31
|
my $map=$self->[$self->COLUMN_MAP]; |
99
|
|
|
|
|
|
|
|
100
|
10
|
|
|
|
|
25
|
for(my $id=0;$id<$self->get_column_count;++$id ) { |
101
|
28
|
|
|
|
|
37
|
my $target=$map->[$id]; |
102
|
28
|
100
|
|
|
|
64
|
$result->[$target]=[] unless defined($result->[$target]); |
103
|
|
|
|
|
|
|
|
104
|
28
|
|
|
|
|
36
|
my $ref=$result->[$target]; |
105
|
28
|
|
|
|
|
45
|
my $obj=$self->get_result_by_id($id); |
106
|
|
|
|
|
|
|
|
107
|
28
|
100
|
|
|
|
101
|
push @$ref,$id if defined($obj); |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
10
|
|
|
|
|
40
|
return $result; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub get_root_results { |
114
|
10
|
|
|
10
|
1
|
36
|
my ($self)=@_; |
115
|
|
|
|
|
|
|
|
116
|
10
|
|
|
|
|
13
|
my $result=[]; |
117
|
|
|
|
|
|
|
|
118
|
10
|
|
|
|
|
21
|
my $map=$self->[$self->COLUMN_MAP]; |
119
|
|
|
|
|
|
|
|
120
|
10
|
|
|
|
|
21
|
for(my $id=0;$id<$self->get_column_count;++$id ) { |
121
|
28
|
|
|
|
|
34
|
my $target=$map->[$id]; |
122
|
28
|
100
|
|
|
|
58
|
$result->[$target]=[] unless defined($result->[$target]); |
123
|
|
|
|
|
|
|
|
124
|
28
|
|
|
|
|
28
|
my $ref=$result->[$target]; |
125
|
28
|
|
|
|
|
42
|
my $obj=$self->get_result_by_id($id); |
126
|
28
|
100
|
|
|
|
62
|
next unless defined($obj); |
127
|
|
|
|
|
|
|
|
128
|
17
|
|
|
|
|
43
|
push @$ref,$obj; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
10
|
|
|
|
|
25
|
return $result; |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
1; |