line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
###
|
3
|
|
|
|
|
|
|
# CSS::SAC::SelectorList - SAC SelectorLists
|
4
|
|
|
|
|
|
|
# Robin Berjon
|
5
|
|
|
|
|
|
|
# 24/02/2001 - prototype mark I of the new model
|
6
|
|
|
|
|
|
|
###
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package CSS::SAC::SelectorList;
|
9
|
2
|
|
|
2
|
|
12
|
use strict;
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
81
|
|
10
|
2
|
|
|
2
|
|
12
|
use vars qw($VERSION);
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
452
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
$VERSION = $CSS::SAC::VERSION || '0.03';
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
### Constructor #######################################################
|
16
|
|
|
|
|
|
|
# #
|
17
|
|
|
|
|
|
|
# #
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
21
|
|
|
|
|
|
|
# CSS::SAC::SelectorList->new(\@list)
|
22
|
|
|
|
|
|
|
# creates a new list
|
23
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
24
|
|
|
|
|
|
|
sub new {
|
25
|
44
|
|
|
44
|
1
|
55
|
my $class = shift;
|
26
|
44
|
|
50
|
|
|
97
|
my $list = shift || [];
|
27
|
|
|
|
|
|
|
|
28
|
44
|
|
|
|
|
255
|
return bless $list, $class;
|
29
|
|
|
|
|
|
|
}
|
30
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# #
|
34
|
|
|
|
|
|
|
# #
|
35
|
|
|
|
|
|
|
### Constructor #######################################################
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
### Accessors #########################################################
|
40
|
|
|
|
|
|
|
# #
|
41
|
|
|
|
|
|
|
# #
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
45
|
|
|
|
|
|
|
# $sl->Length
|
46
|
|
|
|
|
|
|
# returns the length of the list
|
47
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
48
|
|
|
|
|
|
|
sub Length {
|
49
|
0
|
|
|
0
|
1
|
|
return scalar @$_[0];
|
50
|
|
|
|
|
|
|
}
|
51
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
52
|
|
|
|
|
|
|
*CSS::SAC::SelectorList::getLength = \&Length;
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
55
|
|
|
|
|
|
|
# $sl->Item($pos,[$sel])
|
56
|
|
|
|
|
|
|
# get/set the item at that position
|
57
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
58
|
|
|
|
|
|
|
sub Item {
|
59
|
0
|
0
|
|
0
|
1
|
|
(@_ == 2) ? $_[0]->[$_[1]] = $_[2] :
|
60
|
|
|
|
|
|
|
$_[0]->[$_[1]];
|
61
|
|
|
|
|
|
|
}
|
62
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
63
|
|
|
|
|
|
|
*CSS::SAC::SelectorList::item = \&Item;
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
# #
|
67
|
|
|
|
|
|
|
# #
|
68
|
|
|
|
|
|
|
### Accessors #########################################################
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=pod
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 NAME
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
CSS::SAC::SelectorList - SAC SelectorLists
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
fill this in later...
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
SAC SelectorLists are simple arrayrefs with a few methods on top. I
|
84
|
|
|
|
|
|
|
recommend that you use them the Perl way because they are really
|
85
|
|
|
|
|
|
|
nothing more than arrays. However there was demand for the methods
|
86
|
|
|
|
|
|
|
that exist in the spec, so I added this interface.
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 METHODS
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=over
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=item * CSS::SAC::SelectorList->new(\@selectors) or $sl->new(\@selectors)
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Creates a new sl, optionally with those selectors.
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=item * $sl->Length
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Returns the length of the array
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=item * $sel->Item($index,[$selector])
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
get/set a selector at that (0-based) index in the array
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=back
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 AUTHOR
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Robin Berjon
|
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
This module is licensed under the same terms as Perl itself.
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=cut
|