line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Data::Seek Search Result Class |
2
|
|
|
|
|
|
|
package Data::Seek::Search::Result; |
3
|
|
|
|
|
|
|
|
4
|
3
|
|
|
3
|
|
1239
|
use Data::Seek::Data; |
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
128
|
|
5
|
3
|
|
|
3
|
|
470
|
use Data::Seek::Exception; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
80
|
|
6
|
3
|
|
|
3
|
|
435
|
use Data::Seek::Search; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
92
|
|
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
15
|
use Data::Object::Class; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
21
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.08'; # VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has 'datasets' => ( |
13
|
|
|
|
|
|
|
is => 'ro', |
14
|
|
|
|
|
|
|
default => sub { shift->search->perform }, |
15
|
|
|
|
|
|
|
lazy => 1 |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has 'search' => ( |
19
|
|
|
|
|
|
|
is => 'ro', |
20
|
|
|
|
|
|
|
default => sub { Data::Seek::Search->new }, |
21
|
|
|
|
|
|
|
lazy => 1 |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub data { |
25
|
1
|
|
|
1
|
1
|
1695
|
my $self = shift; |
26
|
1
|
|
|
|
|
6
|
my $sets = $self->datasets; |
27
|
1
|
|
|
|
|
2
|
my $data = {}; |
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
|
|
2
|
for my $set (@$sets) { |
30
|
2
|
|
|
|
|
4
|
for my $node (@{$$set{nodes}}) { |
|
2
|
|
|
|
|
4
|
|
31
|
4
|
|
|
|
|
10
|
$$data{$node} = $$set{dataset}{$node}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
|
|
10
|
$data = Data::Seek::Data->new($data); |
36
|
1
|
|
|
|
|
20
|
return $data->decode; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub nodes { |
40
|
1
|
|
|
1
|
1
|
36083
|
my $self = shift; |
41
|
1
|
|
|
|
|
25
|
my $sets = $self->datasets; |
42
|
1
|
|
|
|
|
7
|
my $keys = []; |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
2
|
for my $set (@$sets) { |
45
|
2
|
|
|
|
|
3
|
push @$keys, sort @{$$set{nodes}}; |
|
2
|
|
|
|
|
7
|
|
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
1
|
|
|
|
|
4
|
return $keys; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub values { |
52
|
47
|
|
|
47
|
1
|
1107
|
my $self = shift; |
53
|
47
|
|
|
|
|
1021
|
my $sets = $self->datasets; |
54
|
36
|
|
|
|
|
72
|
my $vals = []; |
55
|
|
|
|
|
|
|
|
56
|
36
|
|
|
|
|
80
|
for my $set (@$sets) { |
57
|
25
|
|
|
|
|
36
|
push @$vals, $$set{dataset}{$_} for sort @{$$set{nodes}}; |
|
25
|
|
|
|
|
349
|
|
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
36
|
|
|
|
|
264
|
return $vals; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__ |