line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bio::Tools::EUtilities::Summary::ItemContainerI; |
2
|
|
|
|
|
|
|
$Bio::Tools::EUtilities::Summary::ItemContainerI::VERSION = '1.76'; |
3
|
1
|
|
|
1
|
|
9
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
4
|
1
|
|
|
1
|
|
29
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
6
|
1
|
|
|
1
|
|
5
|
use base qw(Bio::Tools::EUtilities::EUtilDataI); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
705
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# ABSTRACT: Abtract interface methods for accessing Item information from any Item-containing class. This pertains to either DocSums or to Items themselves (which can be layered). |
9
|
|
|
|
|
|
|
# AUTHOR: Chris Fields |
10
|
|
|
|
|
|
|
# OWNER: 2006-2013 Chris Fields |
11
|
|
|
|
|
|
|
# LICENSE: Perl_5 |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub next_Item { |
16
|
0
|
|
|
0
|
1
|
0
|
my ($self, $request) = @_; |
17
|
0
|
0
|
|
|
|
0
|
unless ($self->{"_items_it"}) { |
18
|
0
|
0
|
0
|
|
|
0
|
my @items = ($request && $request eq 'flatten') ? |
19
|
|
|
|
|
|
|
$self->get_all_Items : |
20
|
|
|
|
|
|
|
$self->get_Items ; |
21
|
0
|
|
|
0
|
|
0
|
$self->{"_items_it"} = sub {return shift @items} |
22
|
0
|
|
|
|
|
0
|
} |
23
|
0
|
|
|
|
|
0
|
$self->{'_items_it'}->(); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub get_Items { |
28
|
7
|
|
|
7
|
1
|
1037
|
my $self = shift; |
29
|
7
|
50
|
|
|
|
26
|
return ref $self->{'_items'} ? @{ $self->{'_items'} } : return (); |
|
7
|
|
|
|
|
30
|
|
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub get_all_Items { |
34
|
13
|
|
|
13
|
1
|
33
|
my $self = shift; |
35
|
13
|
100
|
|
|
|
34
|
unless ($self->{'_ordered_items'}) { |
36
|
6
|
|
|
|
|
25
|
for my $item ($self->get_Items) { |
37
|
52
|
|
|
|
|
80
|
push @{$self->{'_ordered_items'}}, $item; |
|
52
|
|
|
|
|
102
|
|
38
|
52
|
|
|
|
|
118
|
for my $ls ($item->get_ListItems) { |
39
|
16
|
|
|
|
|
29
|
push @{$self->{'_ordered_items'}}, $ls; |
|
16
|
|
|
|
|
31
|
|
40
|
16
|
|
|
|
|
42
|
for my $st ($ls->get_StructureItems) { |
41
|
80
|
|
|
|
|
133
|
push @{$self->{'_ordered_items'}}, $st; |
|
80
|
|
|
|
|
174
|
|
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
} |
46
|
13
|
|
|
|
|
24
|
return @{$self->{'_ordered_items'}}; |
|
13
|
|
|
|
|
48
|
|
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub get_all_names { |
51
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
52
|
0
|
|
|
|
|
0
|
my %tmp; |
53
|
0
|
|
|
|
|
0
|
my @data = grep {!$tmp{$_}++} |
54
|
0
|
|
|
|
|
0
|
map {$_->get_name} $self->get_all_Items; |
|
0
|
|
|
|
|
0
|
|
55
|
0
|
|
|
|
|
0
|
return @data; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub get_Items_by_name { |
60
|
0
|
|
|
0
|
1
|
0
|
my ($self, $key) = @_; |
61
|
0
|
0
|
|
|
|
0
|
return unless $key; |
62
|
0
|
|
|
|
|
0
|
my @data = grep {$_->get_name eq $key} |
|
0
|
|
|
|
|
0
|
|
63
|
|
|
|
|
|
|
$self->get_all_Items; |
64
|
0
|
|
|
|
|
0
|
return @data; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub get_contents_by_name { |
69
|
5
|
|
|
5
|
1
|
15
|
my ($self, $key) = @_; |
70
|
5
|
50
|
|
|
|
14
|
return unless $key; |
71
|
19
|
|
|
|
|
42
|
my @data = map {$_->get_content} |
72
|
5
|
|
|
|
|
14
|
grep {$_->get_name eq $key} |
|
136
|
|
|
|
|
260
|
|
73
|
|
|
|
|
|
|
$self->get_all_Items; |
74
|
5
|
|
|
|
|
40
|
return @data; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub get_type_by_name { |
79
|
5
|
|
|
5
|
1
|
19
|
my ($self, $key) = @_; |
80
|
5
|
50
|
|
|
|
13
|
return unless $key; |
81
|
5
|
|
|
|
|
16
|
my ($it) = grep {$_->get_name eq $key} $self->get_all_Items; |
|
136
|
|
|
|
|
288
|
|
82
|
5
|
|
|
|
|
21
|
return $it->get_type; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
1; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
__END__ |