| 1 | package Bio::Tools::EUtilities::Summary::ItemContainerI; | ||||||||||||||||||||||||||||
| 2 | BEGIN { | ||||||||||||||||||||||||||||
| 3 | 4 | ▶ | $Bio::Tools::EUtilities::Summary::ItemContainerI::AUTHORITY = 'cpan:BIOPERLML'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | } | ||||||||||||||||||||||||||||
| 5 | { | ||||||||||||||||||||||||||||
| 6 | 4 | $Bio::Tools::EUtilities::Summary::ItemContainerI::VERSION = '1.73'; | |||||||||||||||||||||||||||
| 7 | } | ||||||||||||||||||||||||||||
| 8 | 4 | ▶ | use utf8; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 4 | ▶ | use base qw(Bio::Tools::EUtilities::EUtilDataI); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | # 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). | ||||||||||||||||||||||||||||
| 14 | # AUTHOR: Chris Fields <cjfields@bioperl.org> | ||||||||||||||||||||||||||||
| 15 | # OWNER: 2006-2013 Chris Fields | ||||||||||||||||||||||||||||
| 16 | # LICENSE: Perl_5 | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | sub next_Item { | ||||||||||||||||||||||||||||
| 21 | 0 | ▶ | my ($self, $request) = @_; | ||||||||||||||||||||||||||
|
Subroutine
next_Item: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||
| 22 | 0 | ▶ | unless ($self->{"_items_it"}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | 0 | ▶ | my @items = ($request && $request eq 'flatten') ? | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$request and $request eq "flatten"
MC/DC0%0/2
$request and $request eq "flatten"
$request
$request eq "flatten"
Truth table0%0/3
A and B
A= $requestB= $request eq "flatten"
| |||||||||||||||||||||||||||||
| 24 | $self->get_all_Items : | ||||||||||||||||||||||||||||
| 25 | $self->get_Items ; | ||||||||||||||||||||||||||||
| 26 | 0 | ▶ | $self->{"_items_it"} = sub {return shift @items} | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 27 | 0 | } | |||||||||||||||||||||||||||
| 28 | 0 | $self->{'_items_it'}->(); | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | sub get_Items { | ||||||||||||||||||||||||||||
| 33 | 7 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
get_Items: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||||||||||||||||||
| 34 | 7 | ▶ | return ref $self->{'_items'} ? @{ $self->{'_items'} } : return (); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | sub get_all_Items { | ||||||||||||||||||||||||||||
| 39 | 13 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
get_all_Items: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||||||||
| 40 | 13 | ▶ | unless ($self->{'_ordered_items'}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 41 | 6 | for my $item ($self->get_Items) { | |||||||||||||||||||||||||||
| 42 | 52 | push @{$self->{'_ordered_items'}}, $item; | |||||||||||||||||||||||||||
| 43 | 52 | for my $ls ($item->get_ListItems) { | |||||||||||||||||||||||||||
| 44 | 16 | push @{$self->{'_ordered_items'}}, $ls; | |||||||||||||||||||||||||||
| 45 | 16 | for my $st ($ls->get_StructureItems) { | |||||||||||||||||||||||||||
| 46 | 80 | push @{$self->{'_ordered_items'}}, $st; | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||
| 51 | 13 | return @{$self->{'_ordered_items'}}; | |||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | sub get_all_names { | ||||||||||||||||||||||||||||
| 56 | 0 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||
|
Subroutine
get_all_names: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 57 | 0 | my %tmp; | |||||||||||||||||||||||||||
| 58 | 0 | my @data = grep {!$tmp{$_}++} | |||||||||||||||||||||||||||
| 59 | 0 | map {$_->get_name} $self->get_all_Items; | |||||||||||||||||||||||||||
| 60 | 0 | return @data; | |||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | sub get_Items_by_name { | ||||||||||||||||||||||||||||
| 65 | 0 | ▶ | my ($self, $key) = @_; | ||||||||||||||||||||||||||
|
Subroutine
get_Items_by_name: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 66 | 0 | ▶ | return unless $key; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 67 | 0 | my @data = grep {$_->get_name eq $key} | |||||||||||||||||||||||||||
| 68 | $self->get_all_Items; | ||||||||||||||||||||||||||||
| 69 | 0 | return @data; | |||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | sub get_contents_by_name { | ||||||||||||||||||||||||||||
| 74 | 5 | ▶ | my ($self, $key) = @_; | ||||||||||||||||||||||||||
|
Subroutine
get_contents_by_name: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||
| 75 | 5 | ▶ | return unless $key; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 76 | 19 | my @data = map {$_->get_content} | |||||||||||||||||||||||||||
| 77 | 5 | grep {$_->get_name eq $key} | |||||||||||||||||||||||||||
| 78 | $self->get_all_Items; | ||||||||||||||||||||||||||||
| 79 | 5 | return @data; | |||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||
| 83 | sub get_type_by_name { | ||||||||||||||||||||||||||||
| 84 | 5 | ▶ | my ($self, $key) = @_; | ||||||||||||||||||||||||||
|
Subroutine
get_type_by_name: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||
| 85 | 5 | ▶ | return unless $key; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 86 | 5 | my ($it) = grep {$_->get_name eq $key} $self->get_all_Items; | |||||||||||||||||||||||||||
| 87 | 5 | return $it->get_type; | |||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | 4 | 1; | |||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | __END__ | ||||||||||||||||||||||||||||