line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package TransformedUnit; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use unitConverter; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
15
|
|
7
|
1
|
|
|
1
|
|
5
|
use unit; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
32
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# heritage |
10
|
1
|
|
|
1
|
|
6
|
use base qw( Unit ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
601
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
12
|
|
|
12
|
|
25
|
my ( $class, $toReference, $reference ) = @_; |
14
|
12
|
|
33
|
|
|
28
|
$class = ref($class) || $class; |
15
|
12
|
|
|
|
|
26
|
my $this = $class->SUPER::new(); |
16
|
12
|
|
|
|
|
17
|
bless($this, $class); |
17
|
12
|
|
|
|
|
22
|
$this->{TO_REFERENCE} = $toReference; |
18
|
12
|
|
|
|
|
15
|
$this->{REFERENCE} = $reference; |
19
|
12
|
|
|
|
|
38
|
return $this; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub toReference { |
23
|
14
|
|
|
14
|
|
22
|
my $this = shift; |
24
|
14
|
|
|
|
|
30
|
return $this->{TO_REFERENCE}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub reference { |
28
|
14
|
|
|
14
|
|
17
|
my $this = shift; |
29
|
14
|
|
|
|
|
33
|
return $this->{REFERENCE}; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub toBase { |
33
|
14
|
|
|
14
|
|
19
|
my $this = shift; |
34
|
14
|
|
|
|
|
25
|
return $this->reference->toBase->concatenate($this->toReference); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 NAME |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
TransformedUnit - representation of an unit based on a referenced unit and an unit conversion |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 DESCRIPTION |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
This module maps a conceptual class that represents an unit based on a referenced unit and an unit conversion. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 AUTHOR |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Samuel Andres |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 LICENSE |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
UnLicense |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |