line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::RecordStream::Clumper::KeyPerfect; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
18
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
89
|
|
4
|
4
|
|
|
4
|
|
14
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
77
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
1291
|
use App::RecordStream::Clumper::Key; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
87
|
|
7
|
4
|
|
|
4
|
|
1438
|
use App::RecordStream::DomainLanguage::Registry; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
91
|
|
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
22
|
use base 'App::RecordStream::Clumper::Key'; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
1128
|
|
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
|
92
|
return [[], {}]; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub key_clumper_push_record |
30
|
|
|
|
|
|
|
{ |
31
|
99
|
|
|
99
|
0
|
153
|
my $this = shift; |
32
|
99
|
|
|
|
|
131
|
my $cookie = shift; |
33
|
99
|
|
|
|
|
138
|
my $value = shift; |
34
|
99
|
|
|
|
|
129
|
my $record = shift; |
35
|
99
|
|
|
|
|
134
|
my $next = shift; |
36
|
|
|
|
|
|
|
|
37
|
99
|
|
|
|
|
189
|
for my $value ($this->get_values($value)) |
38
|
|
|
|
|
|
|
{ |
39
|
129
|
|
|
|
|
220
|
my $next_cookie = $cookie->[1]->{$value}; |
40
|
129
|
100
|
|
|
|
225
|
if(!defined($next_cookie)) |
41
|
|
|
|
|
|
|
{ |
42
|
49
|
|
|
|
|
98
|
push @{$cookie->[0]}, $value; |
|
49
|
|
|
|
|
116
|
|
43
|
49
|
|
|
|
|
135
|
$next_cookie = $cookie->[1]->{$value} = $next->key_clumper_callback_begin_value($value); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
129
|
|
|
|
|
288
|
$next->key_clumper_callback_push_record($next_cookie, $record); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub get_values |
51
|
|
|
|
|
|
|
{ |
52
|
69
|
|
|
69
|
0
|
93
|
my $this = shift; |
53
|
69
|
|
|
|
|
91
|
my $value = shift; |
54
|
|
|
|
|
|
|
|
55
|
69
|
|
|
|
|
128
|
return ($value); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub key_clumper_end |
59
|
|
|
|
|
|
|
{ |
60
|
20
|
|
|
20
|
0
|
34
|
my $this = shift; |
61
|
20
|
|
|
|
|
30
|
my $cookie = shift; |
62
|
20
|
|
|
|
|
30
|
my $next = shift; |
63
|
|
|
|
|
|
|
|
64
|
20
|
|
|
|
|
31
|
for my $value (@{$cookie->[0]}) |
|
20
|
|
|
|
|
47
|
|
65
|
|
|
|
|
|
|
{ |
66
|
49
|
|
|
|
|
88
|
my $next_cookie = $cookie->[1]->{$value}; |
67
|
49
|
|
|
|
|
111
|
$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; |