line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
### |
3
|
|
|
|
|
|
|
### Copyright 2002-2003 University of Illinois Board of Trustees |
4
|
|
|
|
|
|
|
### Copyright 2002-2003 Mark D. Roth |
5
|
|
|
|
|
|
|
### All rights reserved. |
6
|
|
|
|
|
|
|
### |
7
|
|
|
|
|
|
|
### Config::Objective::List - list data type for Config::Objective |
8
|
|
|
|
|
|
|
### |
9
|
|
|
|
|
|
|
### Mark D. Roth |
10
|
|
|
|
|
|
|
### Campus Information Technologies and Educational Services |
11
|
|
|
|
|
|
|
### University of Illinois at Urbana-Champaign |
12
|
|
|
|
|
|
|
### |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
package Config::Objective::List; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
470
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
4
|
use Config::Objective::DataType; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
348
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
our @ISA = qw(Config::Objective::DataType); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
############################################################################### |
25
|
|
|
|
|
|
|
### default is add() method |
26
|
|
|
|
|
|
|
############################################################################### |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub default |
29
|
|
|
|
|
|
|
{ |
30
|
4
|
|
|
4
|
1
|
7
|
my ($self, $value) = @_; |
31
|
|
|
|
|
|
|
|
32
|
4
|
|
|
|
|
22
|
$self->add($value); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
############################################################################### |
37
|
|
|
|
|
|
|
### unset method |
38
|
|
|
|
|
|
|
############################################################################### |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub unset |
41
|
|
|
|
|
|
|
{ |
42
|
4
|
|
|
4
|
1
|
5
|
my ($self) = @_; |
43
|
|
|
|
|
|
|
|
44
|
4
|
|
|
|
|
9
|
$self->{'value'} = []; |
45
|
4
|
|
|
|
|
8
|
return 1; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
############################################################################### |
50
|
|
|
|
|
|
|
### set method |
51
|
|
|
|
|
|
|
############################################################################### |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub set |
54
|
|
|
|
|
|
|
{ |
55
|
0
|
|
|
0
|
1
|
0
|
my ($self, $value) = @_; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# print "==> List::set($value)\n"; |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
0
|
$self->unset(); |
60
|
0
|
|
|
|
|
0
|
return $self->add($value); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
############################################################################### |
65
|
|
|
|
|
|
|
### add method |
66
|
|
|
|
|
|
|
############################################################################### |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub add |
69
|
|
|
|
|
|
|
{ |
70
|
7
|
|
|
7
|
1
|
13
|
my ($self, $value) = @_; |
71
|
|
|
|
|
|
|
|
72
|
7
|
|
|
|
|
43
|
$value = $self->_scalar_or_list($value); |
73
|
7
|
50
|
|
|
|
22
|
$self->{'value'} = [] |
74
|
|
|
|
|
|
|
if (!defined($self->{'value'})); |
75
|
7
|
|
|
|
|
9
|
push(@{$self->{'value'}}, @$value); |
|
7
|
|
|
|
|
21
|
|
76
|
|
|
|
|
|
|
|
77
|
7
|
|
|
|
|
25
|
return 1; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
############################################################################### |
82
|
|
|
|
|
|
|
### add_top method |
83
|
|
|
|
|
|
|
############################################################################### |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub add_top |
86
|
|
|
|
|
|
|
{ |
87
|
1
|
|
|
1
|
1
|
2
|
my ($self, $value) = @_; |
88
|
|
|
|
|
|
|
|
89
|
1
|
|
|
|
|
5
|
$value = $self->_scalar_or_list($value); |
90
|
1
|
50
|
|
|
|
4
|
$self->{'value'} = [] |
91
|
|
|
|
|
|
|
if (!defined($self->{'value'})); |
92
|
1
|
|
|
|
|
3
|
unshift(@{$self->{'value'}}, @$value); |
|
1
|
|
|
|
|
4
|
|
93
|
|
|
|
|
|
|
|
94
|
1
|
|
|
|
|
5
|
return 1; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
############################################################################### |
99
|
|
|
|
|
|
|
### delete method |
100
|
|
|
|
|
|
|
############################################################################### |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub delete |
103
|
|
|
|
|
|
|
{ |
104
|
2
|
|
|
2
|
1
|
4
|
my ($self, $value) = @_; |
105
|
2
|
|
|
|
|
3
|
my ($val); |
106
|
|
|
|
|
|
|
|
107
|
2
|
|
|
|
|
8
|
$value = $self->_scalar_or_list($value); |
108
|
2
|
50
|
|
|
|
8
|
$self->{'value'} = [] |
109
|
|
|
|
|
|
|
if (!defined($self->{'value'})); |
110
|
2
|
|
|
|
|
5
|
foreach $val (@$value) |
111
|
|
|
|
|
|
|
{ |
112
|
3
|
|
|
|
|
6
|
$self->{'value'} = [ grep !/$val/, @{$self->{'value'}} ]; |
|
3
|
|
|
|
|
55
|
|
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
2
|
|
|
|
|
7
|
return 1; |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
############################################################################### |
120
|
|
|
|
|
|
|
### cleanup and documentation |
121
|
|
|
|
|
|
|
############################################################################### |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
1; |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
__END__ |