line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OPTiMaDe::Filter::Negation; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
38
|
use strict; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
168
|
|
4
|
5
|
|
|
5
|
|
26
|
use warnings; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
1517
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
7
|
21
|
|
|
21
|
0
|
43
|
my( $class, $inner ) = @_; |
8
|
21
|
|
|
|
|
68
|
return bless { inner => $inner }, $class; |
9
|
|
|
|
|
|
|
} |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub inner |
12
|
|
|
|
|
|
|
{ |
13
|
60
|
|
|
60
|
0
|
81
|
my( $self, $inner ) = @_; |
14
|
60
|
|
|
|
|
79
|
my $previous_inner = $self->{inner}; |
15
|
60
|
50
|
|
|
|
98
|
$self->{inner} = $inner if defined $inner; |
16
|
60
|
|
|
|
|
141
|
return $previous_inner; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub to_filter |
20
|
|
|
|
|
|
|
{ |
21
|
20
|
|
|
20
|
0
|
1811
|
my( $self ) = @_; |
22
|
20
|
|
|
|
|
53
|
$self->validate; |
23
|
20
|
|
|
|
|
32
|
return '(NOT ' . $self->inner->to_filter . ')'; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub to_SQL |
27
|
|
|
|
|
|
|
{ |
28
|
10
|
|
|
10
|
0
|
39
|
my( $self, $options ) = @_; |
29
|
10
|
|
|
|
|
22
|
$self->validate; |
30
|
|
|
|
|
|
|
|
31
|
10
|
|
|
|
|
24
|
my( $sql, $values ) = $self->inner->to_SQL( $options ); |
32
|
10
|
100
|
|
|
|
26
|
if( wantarray ) { |
33
|
8
|
|
|
|
|
31
|
return ( "(NOT $sql)", $values ); |
34
|
|
|
|
|
|
|
} else { |
35
|
2
|
|
|
|
|
9
|
return "(NOT $sql)"; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub modify |
40
|
|
|
|
|
|
|
{ |
41
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
42
|
0
|
|
|
|
|
0
|
my $code = shift; |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
0
|
$self->inner( OPTiMaDe::Filter::modify( $self->inner, $code, @_ ) ); |
45
|
0
|
|
|
|
|
0
|
return $code->( $self, @_ ); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub validate |
49
|
|
|
|
|
|
|
{ |
50
|
30
|
|
|
30
|
0
|
42
|
my $self = shift; |
51
|
30
|
50
|
|
|
|
50
|
die 'inner undefined for OPTiMaDe::Filter::Negation' if !$self->inner; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |