| 1 | package Lingua::ZH::CCDICT::ResultSet::Array; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use base 'Lingua::ZH::CCDICT::ResultSet'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | |||||||||||
| 9 | sub new | ||||||||||
| 10 | 9 | ▶ | { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 11 | 9 | my $class = shift; | |||||||||
| 12 | 9 | my %p = @_; | |||||||||
| 13 | |||||||||||
| 14 | return bless { index => 0, | ||||||||||
| 15 | array => $p{array}, | ||||||||||
| 16 | 9 | }, $class; | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | sub next | ||||||||||
| 20 | 0 | ▶ | { | ||||||||
|
Subroutine
next: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 21 | 0 | my $self = shift; | |||||||||
| 22 | |||||||||||
| 23 | 0 | my $index = $self->{index}; | |||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | unless ( exists $self->{array}[$index] ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | { | ||||||||||
| 27 | 0 | $self->{index} = 0; | |||||||||
| 28 | |||||||||||
| 29 | 0 | return; | |||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | 0 | $self->{index}++; | |||||||||
| 33 | |||||||||||
| 34 | 0 | return $self->{array}[$index]; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | sub all | ||||||||||
| 38 | 9 | ▶ | { | ||||||||
|
Subroutine
all: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 39 | 9 | my $self = shift; | |||||||||
| 40 | |||||||||||
| 41 | 9 | return @{ $self->{array} }; | |||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | |||||||||||
| 45 | 1 | 1; | |||||||||
| 46 | |||||||||||
| 47 | __END__ | ||||||||||