line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package EO::Collection; |
2
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
38
|
use strict; |
|
7
|
|
|
|
|
63
|
|
|
7
|
|
|
|
|
203
|
|
4
|
7
|
|
|
7
|
|
34
|
use warnings; |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
142
|
|
5
|
7
|
|
|
7
|
|
4502
|
use EO; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use EO::Error; |
7
|
|
|
|
|
|
|
our $VERSION = 0.96; |
8
|
|
|
|
|
|
|
our @ISA = qw( EO ); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
exception EO::Error::InvalidParameters; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub element { |
13
|
|
|
|
|
|
|
my $self = CORE::shift; |
14
|
|
|
|
|
|
|
if (@_) { |
15
|
|
|
|
|
|
|
my $thing = shift; |
16
|
|
|
|
|
|
|
if (!ref($thing)) { |
17
|
|
|
|
|
|
|
throw EO::Error::InvalidParameters text => 'not a reference'; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
$self->{ element } = $thing; |
20
|
|
|
|
|
|
|
return $self; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
return $self->{ element }; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub delete : Abstract; |
26
|
|
|
|
|
|
|
sub at : Abstract; |
27
|
|
|
|
|
|
|
sub count : Abstract; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub select : Abstract; |
30
|
|
|
|
|
|
|
sub do : Abstract; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub grep { |
33
|
|
|
|
|
|
|
my $self = shift; |
34
|
|
|
|
|
|
|
$self->select( @_ ); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub foreach { |
38
|
|
|
|
|
|
|
my $self = shift; |
39
|
|
|
|
|
|
|
$self->do( @_ ); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub as_string { |
43
|
|
|
|
|
|
|
my $self = shift; |
44
|
|
|
|
|
|
|
use Data::Dumper qw(); |
45
|
|
|
|
|
|
|
my $d = Data::Dumper->new([ $self->element ]); |
46
|
|
|
|
|
|
|
$d->Indent( 0 ); |
47
|
|
|
|
|
|
|
my $str = $d->Dump; |
48
|
|
|
|
|
|
|
$str =~ s/\$VAR\d\s*=\s*//g; |
49
|
|
|
|
|
|
|
return $str; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |