line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::RecordStream::Clumper::KeyPerfect; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
22
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
88
|
|
4
|
4
|
|
|
4
|
|
17
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
76
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
1327
|
use App::RecordStream::Clumper::Key; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
99
|
|
7
|
4
|
|
|
4
|
|
1567
|
use App::RecordStream::DomainLanguage::Registry; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
100
|
|
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
23
|
use base 'App::RecordStream::Clumper::Key'; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
1125
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub long_usage |
12
|
|
|
|
|
|
|
{ |
13
|
0
|
|
|
0
|
0
|
0
|
return <
|
14
|
|
|
|
|
|
|
Usage: keyperfect, |
15
|
|
|
|
|
|
|
Clump records by the value for a key |
16
|
|
|
|
|
|
|
EOF |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub short_usage |
20
|
|
|
|
|
|
|
{ |
21
|
0
|
|
|
0
|
0
|
0
|
return "clump records by the value for a key"; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub key_clumper_begin |
25
|
|
|
|
|
|
|
{ |
26
|
20
|
|
|
20
|
0
|
82
|
return [[], {}]; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub key_clumper_push_record |
30
|
|
|
|
|
|
|
{ |
31
|
99
|
|
|
99
|
0
|
170
|
my $this = shift; |
32
|
99
|
|
|
|
|
148
|
my $cookie = shift; |
33
|
99
|
|
|
|
|
170
|
my $value = shift; |
34
|
99
|
|
|
|
|
147
|
my $record = shift; |
35
|
99
|
|
|
|
|
162
|
my $next = shift; |
36
|
|
|
|
|
|
|
|
37
|
99
|
|
|
|
|
232
|
for my $value ($this->get_values($value)) |
38
|
|
|
|
|
|
|
{ |
39
|
129
|
|
|
|
|
257
|
my $next_cookie = $cookie->[1]->{$value}; |
40
|
129
|
100
|
|
|
|
297
|
if(!defined($next_cookie)) |
41
|
|
|
|
|
|
|
{ |
42
|
49
|
|
|
|
|
76
|
push @{$cookie->[0]}, $value; |
|
49
|
|
|
|
|
111
|
|
43
|
49
|
|
|
|
|
152
|
$next_cookie = $cookie->[1]->{$value} = $next->key_clumper_callback_begin_value($value); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
129
|
|
|
|
|
365
|
$next->key_clumper_callback_push_record($next_cookie, $record); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub get_values |
51
|
|
|
|
|
|
|
{ |
52
|
69
|
|
|
69
|
0
|
114
|
my $this = shift; |
53
|
69
|
|
|
|
|
111
|
my $value = shift; |
54
|
|
|
|
|
|
|
|
55
|
69
|
|
|
|
|
160
|
return ($value); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub key_clumper_end |
59
|
|
|
|
|
|
|
{ |
60
|
20
|
|
|
20
|
0
|
43
|
my $this = shift; |
61
|
20
|
|
|
|
|
36
|
my $cookie = shift; |
62
|
20
|
|
|
|
|
34
|
my $next = shift; |
63
|
|
|
|
|
|
|
|
64
|
20
|
|
|
|
|
35
|
for my $value (@{$cookie->[0]}) |
|
20
|
|
|
|
|
55
|
|
65
|
|
|
|
|
|
|
{ |
66
|
49
|
|
|
|
|
100
|
my $next_cookie = $cookie->[1]->{$value}; |
67
|
49
|
|
|
|
|
137
|
$next->key_clumper_callback_end($next_cookie); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
App::RecordStream::Clumper->register_implementation('keyperfect', __PACKAGE__); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
App::RecordStream::DomainLanguage::Registry::register_vfn(__PACKAGE__, 'new_from_valuation', 'keyperfect', 'VALUATION'); |
74
|
|
|
|
|
|
|
App::RecordStream::DomainLanguage::Registry::register_vfn(__PACKAGE__, 'new_from_valuation', 'key', 'VALUATION'); |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |