line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Book::Bilingual::Dlineset; |
2
|
|
|
|
|
|
|
# ABSTRACT: A set of dual language lines |
3
|
4
|
|
|
4
|
|
822
|
use Mojo::Base -base; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
26
|
|
4
|
4
|
|
|
4
|
|
602
|
use Carp; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
1153
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has 'set'; # Arrayref of Dlines |
7
|
|
|
|
|
|
|
|
8
|
187
|
|
|
187
|
1
|
1553
|
sub new { $_[0]->SUPER::new({ set => [] }) } |
9
|
|
|
|
|
|
|
sub dline_count { |
10
|
93
|
|
|
93
|
0
|
139
|
my ($self) = @_; |
11
|
93
|
|
|
|
|
95
|
return scalar @{$self->{set}}; |
|
93
|
|
|
|
|
164
|
|
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
sub at { ## ($idx :>Int) :> Dline |
14
|
1
|
|
|
1
|
0
|
2
|
my ($self, $idx) = @_; |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
|
|
4
|
return $self->{set}[$idx]; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
sub target { ## () :> Dline |
19
|
84
|
|
|
84
|
0
|
103
|
my ($self, $idx) = @_; |
20
|
|
|
|
|
|
|
|
21
|
84
|
|
|
|
|
219
|
return $self->{set}[-1]; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
sub push { ## ($d:Dline) :> $Dlineset |
24
|
7
|
|
|
7
|
0
|
54
|
my ($self,$d) = @_; |
25
|
|
|
|
|
|
|
|
26
|
7
|
100
|
|
|
|
172
|
croak 'Not a Book::Bilingual::Dline' |
27
|
|
|
|
|
|
|
unless ref($d) eq 'Book::Bilingual::Dline'; |
28
|
|
|
|
|
|
|
|
29
|
6
|
|
|
|
|
8
|
push @{$self->{set}}, $d; |
|
6
|
|
|
|
|
15
|
|
30
|
|
|
|
|
|
|
|
31
|
6
|
|
|
|
|
18
|
return $self; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |