line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Biblio::SICI::ControlSegment; |
3
|
|
|
|
|
|
|
{ |
4
|
|
|
|
|
|
|
$Biblio::SICI::ControlSegment::VERSION = '0.04'; |
5
|
|
|
|
|
|
|
} |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: The control segment of a SICI |
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
17
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
115
|
|
10
|
3
|
|
|
3
|
|
18
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
95
|
|
11
|
3
|
|
|
3
|
|
77
|
use 5.010001; |
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
130
|
|
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
3
|
|
15
|
use Moo; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
27
|
|
14
|
3
|
|
|
3
|
|
940
|
use Sub::Quote; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
241
|
|
15
|
|
|
|
|
|
|
|
16
|
3
|
|
|
3
|
|
18
|
use Biblio::SICI; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
2197
|
|
17
|
|
|
|
|
|
|
with 'Biblio::SICI::Role::ValidSegment', 'Biblio::SICI::Role::RecursiveLink'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has 'dpi' => ( |
21
|
|
|
|
|
|
|
is => 'rw', lazy => 1, |
22
|
|
|
|
|
|
|
trigger => 1, |
23
|
|
|
|
|
|
|
default => quote_sub(q{ 0 }), |
24
|
|
|
|
|
|
|
predicate => 1, |
25
|
|
|
|
|
|
|
clearer => 1, |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub _trigger_dpi { |
29
|
58
|
|
|
58
|
|
2531
|
my ( $self, $newVal ) = @_; |
30
|
|
|
|
|
|
|
|
31
|
58
|
50
|
66
|
|
|
311
|
if ( not( "$newVal" eq "0" or "$newVal" eq "1" or "$newVal" eq "2" or "$newVal" eq "3" ) ) { |
32
|
0
|
|
|
|
|
0
|
$self->log_problem_on( 'dpi' => ['value not in allowed range (0|1|2|3)'] ); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
else { |
35
|
58
|
|
|
|
|
158
|
$self->clear_problem_on('dpi'); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
58
|
|
|
|
|
1130
|
return; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
has 'mfi' => ( |
43
|
|
|
|
|
|
|
is => 'rw', lazy => 1, |
44
|
|
|
|
|
|
|
trigger => 1, |
45
|
|
|
|
|
|
|
default => quote_sub(q{ "ZU" }), |
46
|
|
|
|
|
|
|
predicate => 1, |
47
|
|
|
|
|
|
|
clearer => 1, |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub _trigger_mfi { |
51
|
59
|
|
|
59
|
|
11269
|
my ( $self, $newVal ) = @_; |
52
|
|
|
|
|
|
|
|
53
|
59
|
50
|
|
|
|
258
|
if ( $newVal !~ /\A(?:C[DFOT]|H[DE]|SC|T[BHLSX]|VX|Z[NUZ])\Z/ ) { |
54
|
0
|
|
|
|
|
0
|
$self->log_problem_on( 'mfi' => ['unknown identifier'] ); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
else { |
57
|
59
|
|
|
|
|
163
|
$self->clear_problem_on('mfi'); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
59
|
|
|
|
|
1142
|
return; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
has 'version' => ( |
65
|
|
|
|
|
|
|
is => 'rw', lazy => 1, |
66
|
|
|
|
|
|
|
trigger => 1, |
67
|
|
|
|
|
|
|
default => quote_sub(q{ 2 }), |
68
|
|
|
|
|
|
|
predicate => 1, |
69
|
|
|
|
|
|
|
clearer => 1, |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub _trigger_version { |
73
|
58
|
|
|
58
|
|
5353
|
my ( $self, $newVal ) = @_; |
74
|
|
|
|
|
|
|
|
75
|
58
|
50
|
|
|
|
150
|
if ( $newVal != 2 ) { |
76
|
0
|
|
|
|
|
0
|
$self->log_problem( 'version' => ['unsupported version number (i.e. not "2")'] ); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
else { |
79
|
58
|
|
|
|
|
146
|
$self->clear_problem_on('version'); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
58
|
|
|
|
|
1140
|
return; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub csi { |
87
|
237
|
|
|
237
|
1
|
556
|
my $self = shift; |
88
|
|
|
|
|
|
|
|
89
|
237
|
100
|
|
|
|
4627
|
if ( $self->_sici()->contribution()->has_localNumber() ) { |
90
|
16
|
|
|
|
|
380
|
return 3; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
221
|
100
|
100
|
|
|
5571
|
if ( $self->_sici()->contribution()->has_location() |
94
|
|
|
|
|
|
|
or $self->_sici()->contribution()->has_titleCode() ) |
95
|
|
|
|
|
|
|
{ |
96
|
97
|
|
|
|
|
2267
|
return 2; |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
124
|
|
|
|
|
5691
|
return 1; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub to_string { |
104
|
179
|
|
|
179
|
1
|
1191
|
my $self = shift; |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
# Every attribute in this class has a default value |
107
|
179
|
|
|
|
|
322
|
return sprintf( '%s.%s.%s;%s', $self->csi(), $self->dpi(), $self->mfi(), $self->version() ); |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
sub reset { |
112
|
59
|
|
|
59
|
1
|
432
|
my $self = shift; |
113
|
59
|
|
|
|
|
1154
|
$self->clear_dpi(); |
114
|
59
|
|
|
|
|
1109
|
$self->clear_problem_on('dpi'); |
115
|
59
|
|
|
|
|
1209
|
$self->clear_mfi(); |
116
|
59
|
|
|
|
|
1096
|
$self->clear_problem_on('mfi'); |
117
|
59
|
|
|
|
|
1133
|
$self->clear_version(); |
118
|
59
|
|
|
|
|
986
|
$self->clear_problem_on('version'); |
119
|
59
|
|
|
|
|
122
|
return; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
1; |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
__END__ |