line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Copyright (c) 2004-2006 IBM Corporation. |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# All rights reserved. This program and the accompanying materials |
5
|
|
|
|
|
|
|
# are made available under the terms of the Eclipse Public License v1.0 |
6
|
|
|
|
|
|
|
# which accompanies this distribution, and is available at |
7
|
|
|
|
|
|
|
# http://www.eclipse.org/legal/epl-v10.html |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# File: $Source: /var/lib/cvs/ODO/lib/ODO/Query/Result.pm,v $ |
10
|
|
|
|
|
|
|
# Created by: Stephen Evanchik( evanchik@us.ibm.com ) |
11
|
|
|
|
|
|
|
# Created on: 11/30/2004 |
12
|
|
|
|
|
|
|
# Revision: $Id: Result.pm,v 1.2 2009-11-25 17:53:53 ubuntu Exp $ |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
# Contributors: |
15
|
|
|
|
|
|
|
# IBM Corporation - initial API and implementation |
16
|
|
|
|
|
|
|
# |
17
|
|
|
|
|
|
|
package ODO::Query::Result; |
18
|
|
|
|
|
|
|
|
19
|
5
|
|
|
5
|
|
31
|
use strict; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
189
|
|
20
|
5
|
|
|
5
|
|
28
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
106
|
|
21
|
|
|
|
|
|
|
|
22
|
5
|
|
|
5
|
|
24
|
use ODO::Exception; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
164
|
|
23
|
5
|
|
|
5
|
|
24
|
use vars qw /$VERSION/; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
348
|
|
24
|
|
|
|
|
|
|
$VERSION = sprintf "%d.%02d", q$Revision: 1.2 $ =~ /: (\d+)\.(\d+)/; |
25
|
5
|
|
|
5
|
|
25
|
use base qw/ODO/; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
1316
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__PACKAGE__->mk_ro_accessors(qw/query source_graph bound_vars results/); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 NAME |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
ODO::Query::Result - Result set object |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 SYNOPSIS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Synopsis. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 DESCRIPTION |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Description. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 METHODS |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=over |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=item add_bound_var( $variable ) |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub add_bound_var { |
50
|
0
|
|
|
0
|
1
|
0
|
my ($self, $var) = @_; |
51
|
|
|
|
|
|
|
|
52
|
0
|
0
|
|
|
|
0
|
throw ODO::Exception::Parameter::Invalid(error=> 'Parameter must be an ODO::Node::Variable') |
53
|
|
|
|
|
|
|
unless(UNIVERSAL::isa($var, 'ODO::Node::Variable')); |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
0
|
$self->{'bound_vars'}->{ $var->hash() } = $var; |
56
|
0
|
|
|
|
|
0
|
push @{ $self->{'bound_vars'}->{'#variables'} }, $var; |
|
0
|
|
|
|
|
0
|
|
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
0
|
return $self; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub init { |
63
|
130
|
|
|
130
|
1
|
165
|
my ($self, $config) = @_; |
64
|
130
|
|
|
|
|
380
|
$self->params($config, qw/source_graph query results/); |
65
|
130
|
|
|
|
|
5787
|
$self->{'bound_vars'} = { '#variables'=> []}; |
66
|
130
|
|
|
|
|
344
|
return $self; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=back |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 AUTHOR |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
IBM Corporation |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 COPYRIGHT |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Copyright (c) 2004-2006 IBM Corporation. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
All rights reserved. This program and the accompanying materials |
81
|
|
|
|
|
|
|
are made available under the terms of the Eclipse Public License v1.0 |
82
|
|
|
|
|
|
|
which accompanies this distribution, and is available at |
83
|
|
|
|
|
|
|
http://www.eclipse.org/legal/epl-v10.html |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=cut |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
1; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
__END__ |