| 1 | package PMLTQ::Relation::MemberIterator; | ||||||||||||||||||||||||||||
| 2 | 12 | our $AUTHORITY = 'cpan:MATY'; | |||||||||||||||||||||||||||
| 3 | 12 | $PMLTQ::Relation::MemberIterator::VERSION = '1.2.2'; | |||||||||||||||||||||||||||
| 4 | # ABSTRACT: Iterates over member nodes of given list | ||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 12 | ▶ | use 5.006; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 12 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 12 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 12 | ▶ | use base qw(PMLTQ::Relation::SimpleListIterator); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 12 | ▶ | use constant ATTR => PMLTQ::Relation::SimpleListIterator::FIRST_FREE; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 12 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | sub new { | ||||||||||||||||||||||||||||
| 15 | 0 | ▶ | my ($class,$conditions,$attr)=@_; | ||||||||||||||||||||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 16 | 0 | ▶ | croak "usage: $class->new(sub{...},\$attr)" unless (ref($conditions) eq 'CODE' and defined $attr); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $conditions eq "CODE" and defined $attr
MC/DC0%0/2
ref $conditions eq "CODE" and defined $attr
ref $conditions eq "CODE"
defined $attr
Truth table0%0/3
A and B
A= ref $conditions eq "CODE"B= defined $attr
| |||||||||||||||||||||||||||||
| 17 | 0 | my $self = PMLTQ::Relation::SimpleListIterator->new($conditions); | |||||||||||||||||||||||||||
| 18 | 0 | $self->[ATTR]=$attr; | |||||||||||||||||||||||||||
| 19 | 0 | bless $self, $class; # reblessing | |||||||||||||||||||||||||||
| 20 | 0 | return $self; | |||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | sub clone { | ||||||||||||||||||||||||||||
| 23 | 0 | ▶ | my ($self)=@_; | ||||||||||||||||||||||||||
|
Subroutine
clone: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 24 | 0 | my $clone = $self->PMLTQ::Relation::SimpleListIterator::clone(); | |||||||||||||||||||||||||||
| 25 | 0 | $clone->[ATTR]=$self->[ATTR]; | |||||||||||||||||||||||||||
| 26 | 0 | return $clone; | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | sub get_node_list { | ||||||||||||||||||||||||||||
| 29 | 0 | ▶ | my ($self,$node)=@_; | ||||||||||||||||||||||||||
|
Subroutine
get_node_list: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 30 | 0 | my $fsfile = $self->[PMLTQ::Relation::SimpleListIterator::FILE]; | |||||||||||||||||||||||||||
| 31 | #print STDERR "MemberIterator attr: $self->[ATTR]\n"; | ||||||||||||||||||||||||||||
| 32 | 0 | return [map [$_,$fsfile], Treex::PML::Instance::get_all($node,$self->[ATTR])]; | |||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 12 | 1; # End of PMLTQ::Relation::MemberIterator | |||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | __END__ | ||||||||||||||||||||||||||||