line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::GData::Iterator; |
2
|
16
|
|
|
16
|
|
94
|
use strict; |
|
16
|
|
|
|
|
166
|
|
|
16
|
|
|
|
|
20498
|
|
3
|
|
|
|
|
|
|
sub TIEARRAY { |
4
|
50
|
|
|
50
|
|
78
|
my $class = shift; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
my $this = bless { |
7
|
|
|
|
|
|
|
ARRAY => [], |
8
|
12
|
|
|
12
|
|
30
|
SETTER => shift() || sub { return (shift(),shift())}, |
9
|
14
|
|
|
14
|
|
30
|
GETTER => shift() || sub { return shift()} |
10
|
50
|
|
50
|
|
|
956
|
}, $class; |
|
|
|
100
|
|
|
|
|
11
|
50
|
|
|
|
|
256
|
$this->pointer=0; |
12
|
|
|
|
|
|
|
|
13
|
50
|
|
|
|
|
285
|
return $this; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub ARRAY { |
17
|
858
|
|
|
858
|
0
|
1037
|
my $this = shift; |
18
|
858
|
|
|
|
|
11829
|
$this->{ARRAY}; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub FETCH { |
23
|
138
|
|
|
138
|
|
222
|
my ($this,$index) = @_; |
24
|
138
|
|
|
|
|
265
|
$this->pointer=$index; |
25
|
138
|
50
|
33
|
|
|
248
|
return undef if($this->pointer >= $this->total && $this->total!=0); |
26
|
|
|
|
|
|
|
|
27
|
138
|
50
|
|
|
|
354
|
if(my $code = $this->{GETTER}){ |
28
|
138
|
|
|
|
|
260
|
$this->ARRAY->[$this->pointer]=$code->($this->ARRAY->[$this->pointer]); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
138
|
|
|
|
|
349
|
return $this->ARRAY->[$this->pointer]; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub pointer:lvalue { |
35
|
1022
|
|
|
1022
|
0
|
1172
|
my $this = shift; |
36
|
1022
|
|
|
|
|
3443
|
$this->{pointer}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub STORE { |
41
|
12
|
|
|
12
|
|
18
|
my $this = shift; |
42
|
12
|
|
|
|
|
21
|
my( $index, $value ) = @_; |
43
|
|
|
|
|
|
|
|
44
|
12
|
|
|
|
|
40
|
($index,$value)=$this->{SETTER}->($index,$value); |
45
|
|
|
|
|
|
|
|
46
|
12
|
|
|
|
|
28
|
$this->ARRAY->[$index] = $value; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub FETCHSIZE { |
50
|
141
|
|
|
141
|
|
2860
|
my $this = shift; |
51
|
|
|
|
|
|
|
|
52
|
141
|
100
|
66
|
|
|
282
|
if($this->pointer>=$this->total || $this->pointer<0){ |
53
|
|
|
|
|
|
|
|
54
|
10
|
|
|
|
|
21
|
$this->pointer=0; |
55
|
10
|
|
|
|
|
33
|
return 0; |
56
|
|
|
|
|
|
|
} |
57
|
131
|
|
|
|
|
262
|
return $this->total; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub total { |
61
|
432
|
|
|
432
|
0
|
479
|
my $this = shift; |
62
|
432
|
|
|
|
|
416
|
return scalar (@{$this->ARRAY}); |
|
432
|
|
|
|
|
695
|
|
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
0
|
|
0
|
sub STORESIZE { |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
} |
68
|
0
|
|
|
0
|
|
0
|
sub EXTEND { |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub EXISTS { |
73
|
0
|
|
|
0
|
|
0
|
my ($this,$index) = @_; |
74
|
0
|
0
|
|
|
|
0
|
if(! defined $this->ARRAY->[$index]){ |
75
|
0
|
|
|
|
|
0
|
$this->pointer=0; |
76
|
0
|
|
|
|
|
0
|
return 0; |
77
|
|
|
|
|
|
|
} |
78
|
0
|
|
|
|
|
0
|
return 1; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub DELETE { |
82
|
0
|
|
|
0
|
|
0
|
my ($this,$index) = @_; |
83
|
0
|
|
|
|
|
0
|
return $this->STORE( $index, '' ); |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub CLEAR { |
87
|
0
|
|
|
0
|
|
0
|
my $this = shift; |
88
|
|
|
|
|
|
|
# return $this->ARRAY = []; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
####ARRAY LIKE BEHAVIOR#### |
92
|
|
|
|
|
|
|
sub PUSH { |
93
|
11
|
|
|
11
|
|
21
|
my $this = shift; |
94
|
11
|
|
|
|
|
22
|
my @list = @_; |
95
|
11
|
|
|
|
|
89
|
my $last = $this->total(); |
96
|
11
|
|
|
|
|
56
|
$this->STORE( $last + $_, $list[$_] ) foreach 0 .. $#list; |
97
|
11
|
|
|
|
|
41
|
return $this->total(); |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
sub POP { |
101
|
0
|
|
|
0
|
|
|
my $this = shift; |
102
|
0
|
|
|
|
|
|
return pop @{$this->ARRAY}; |
|
0
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
sub SHIFT { |
106
|
0
|
|
|
0
|
|
|
my $this = shift; |
107
|
0
|
|
|
|
|
|
return shift @{$this->ARRAY}; |
|
0
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
sub UNSHIFT { |
111
|
0
|
|
|
0
|
|
|
my $this = shift; |
112
|
0
|
|
|
|
|
|
my @list = @_; |
113
|
0
|
|
|
|
|
|
my $size = scalar @list; |
114
|
|
|
|
|
|
|
|
115
|
0
|
|
|
|
|
|
@{$this->ARRAY}[ $size .. $#{$this->ARRAY} + $size ] |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
116
|
0
|
|
|
|
|
|
= @{$this->ARRAY}; |
117
|
|
|
|
|
|
|
|
118
|
0
|
|
|
|
|
|
$this->STORE( $_, $list[$_] ) foreach 0 .. $#list; |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub SPLICE { |
122
|
0
|
|
|
0
|
|
|
my $this = shift; |
123
|
0
|
|
0
|
|
|
|
my $offset = shift || 0; |
124
|
0
|
|
0
|
|
|
|
my $length = shift || $this->FETCHSIZE() - $offset; |
125
|
0
|
|
|
|
|
|
my @list = (); |
126
|
0
|
0
|
|
|
|
|
if ( @_ ) { |
127
|
0
|
|
|
|
|
|
tie @list, ref $this; |
128
|
0
|
|
|
|
|
|
@list = @_; |
129
|
|
|
|
|
|
|
} |
130
|
0
|
|
|
|
|
|
return splice @{$this->ARRAY}, $offset, $length, @list; |
|
0
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
'The earth is blue like an orange.'; |