| 1 | package Data::Range::Compare::Stream::Iterator::Base; | ||||||||||
| 2 | |||||||||||
| 3 | 16 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 16 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 16 | ▶ | use overload '""'=>\&to_string,fallback=>1; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 16 | ▶ | use constant NEW_FROM_CLASS=>'Data::Range::Compare::Stream'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 196 | ▶ | sub NEW_FROM { $_[0]->{NEW_FROM} } | ||||||||
|
Subroutine
NEW_FROM: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 10 | |||||||||||
| 11 | 590 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 12 | 590 | my ($class,%args)=@_; | |||||||||
| 13 | 590 | my $self=bless {NEW_FROM=>$class->NEW_FROM_CLASS,%args},$class; | |||||||||
| 14 | |||||||||||
| 15 | 590 | ▶ | unless(exists $self->{factory_instance}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 360 | ▶ | $self->{factory_instance}= exists $self->{new_from} ? $self->{new_from} : $self->NEW_FROM; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | 590 | return $self; | |||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | 62382 | ▶ | sub create_from_factory { | ||||||||
|
Subroutine
create_from_factory: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 23 | 62382 | my ($self,@args)=@_; | |||||||||
| 24 | |||||||||||
| 25 | 62382 | my $range=$self->{factory_instance}->factory(@args); | |||||||||
| 26 | |||||||||||
| 27 | 62382 | return $range; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 33 | ▶ | sub on_consolidate { } | ||||||||
|
Subroutine
on_consolidate: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 31 | |||||||||||
| 32 | 123147 | ▶ | sub has_next { $_[0]->{has_next} } | ||||||||
|
Subroutine
has_next: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 33 | |||||||||||
| 34 | 0 | ▶ | sub get_next { undef } | ||||||||
|
Subroutine
get_next: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 35 | |||||||||||
| 36 | 22 | ▶ | sub to_string { ref($_[0]) } | ||||||||
|
Subroutine
to_string: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 37 | |||||||||||
| 38 | 2 | ▶ | sub delete_from_root { } | ||||||||
|
Subroutine
delete_from_root: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 39 | |||||||||||
| 40 | 0 | ▶ | sub get_child_column_id { undef } | ||||||||
|
Subroutine
get_child_column_id: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 41 | |||||||||||
| 42 | 0 | ▶ | sub get_child { undef } | ||||||||
|
Subroutine
get_child: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 43 | |||||||||||
| 44 | 235 | ▶ | sub set_column_id { $_[0]->{column_id}=$_[1] } | ||||||||
|
Subroutine
set_column_id: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 45 | |||||||||||
| 46 | 114 | ▶ | sub get_column_id { $_[0]->{column_id} } | ||||||||
|
Subroutine
get_column_id: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 47 | |||||||||||
| 48 | 0 | ▶ | sub get_root_column_id {$_[0]->get_column_id } | ||||||||
|
Subroutine
get_root_column_id: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 49 | |||||||||||
| 50 | 0 | ▶ | sub get_root { $_[0] } | ||||||||
|
Subroutine
get_root: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 51 | |||||||||||
| 52 | 82 | ▶ | sub is_child { 0 } | ||||||||
|
Subroutine
is_child: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 53 | 0 | ▶ | sub has_child { 0 } | ||||||||
|
Subroutine
has_child: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 54 | 0 | ▶ | sub is_root { 1 } | ||||||||
|
Subroutine
is_root: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 55 | 0 | ▶ | sub has_root {0} | ||||||||
|
Subroutine
has_root: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 56 | |||||||||||
| 57 | 53263 | ▶ | sub result_to_line { | ||||||||
|
Subroutine
result_to_line: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 58 | 53263 | my ($self,$result)=@_; | |||||||||
| 59 | 53263 | ▶ | return $self->{result_to_line}->($result) if defined($self->{result_to_line}); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 60 | |||||||||||
| 61 | 53254 | my $range=$result->get_common; | |||||||||
| 62 | 53254 | my $line=$range->range_start_to_string.' '.$range->range_end_to_string."\n"; | |||||||||
| 63 | 53254 | return $line; | |||||||||
| 64 | } | ||||||||||
| 65 | |||||||||||
| 66 | 61516 | ▶ | sub parse_line { | ||||||||
|
Subroutine
parse_line: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 67 | 61516 | my ($self,$line)=@_; | |||||||||
| 68 | 61516 | ▶ | return $self->{parse_line}->($line) if defined($self->{parse_line}); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 69 | 61507 | chomp $line; | |||||||||
| 70 | 61507 | [split /\s+/,$line]; | |||||||||
| 71 | } | ||||||||||
| 72 | |||||||||||
| 73 | |||||||||||
| 74 | 16 | 1; | |||||||||
| 75 | |||||||||||