Core/ModelSet.pm untested

filter: Statementstmt 0.0% 0 / 25 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 45 CC 2 SCAR 10.6
CC
2
Cov
0%
existsStmt
6.0
new
2.0
addModel
2.0
CRAP 2.9
1 #
2 # The contents of this file are subject to the Mozilla Public
3 # License Version 1.1 (the "License"); you may not use this file
4 # except in compliance with the License. You may obtain a copy of
5 # the License at http://www.mozilla.org/MPL/
6 #
7 # Software distributed under the License is distributed on an "AS
8 # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9 # implied. See the License for the specific language governing
10 # rights and limitations under the License.
11 #
12 # The Original Code is the RDF::Core module
13 #
14 # The Initial Developer of the Original Code is Ginger Alliance Ltd.
15 # Portions created by Ginger Alliance are
16 # Copyright (C) 2001 Ginger Alliance Ltd.
17 # All Rights Reserved.
18 #
19 # Contributor(s):
20 #
21 # Alternatively, the contents of this file may be used under the
22 # terms of the GNU General Public License Version 2 or later (the
23 # "GPL"), in which case the provisions of the GPL are applicable
24 # instead of those above. If you wish to allow use of your
25 # version of this file only under the terms of the GPL and not to
26 # allow others to use your version of this file under the MPL,
27 # indicate your decision by deleting the provisions above and
28 # replace them with the notice and other provisions required by
29 # the GPL. If you do not delete the provisions above, a recipient
30 # may use your version of this file under either the MPL or the
31 # GPL.
32 #
33  
34 package RDF::Core::ModelSet;
35  
36 use strict;
37 require Exporter;
38  
39  
40 use Carp;
41  
42 sub new {
43 my $pkg = shift;
44 $pkg = ref $pkg || $pkg;
45 my $self = {};
46 bless $self, $pkg;
47 }
48 sub addModel {
49 my ($self, $label, $model) = @_;
50 $self->{_models}->{$label} = $model;
51 }
52 sub removeModel {
53 my ($self, $label) = @_;
54 delete $self->{_models}->{$label};
55 }
56 sub existsStmt {
57 my ($self) = shift;
58 my $retval = 0;
59 foreach my $label (keys $self->{_models}) {
60 if ($self->{_models}->{$label}->existsStmt @_) {
61 $retval = 1;
62 last;
63 }
64 }
65 }
66 sub getStmts {
67 my $self = shift;
68 #TODO: union of enumerators or duplicate values?
69 }
70 1;
71 __END__