Core/Enumerator/Memory.pm

filter: Statementstmt 40.9% 9 / 22 Branchbran n/a Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 33.3% 2 / 6 Podpod 100% 4 / 4 totaltotal 40.5% 15 / 37 CC 2 SCAR 10.5
CC
2
Cov
36%
new
6.0
getFirst
2.0
getNext
2.0
CRAP 2.9
« Core/ModelSet.pm ↑ Summary Core.pm »
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::Enumerator::Memory;
35  
36 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
37 1 require Exporter;
38  
39 1 our @ISA = qw(RDF::Core::Enumerator);
40  
41 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
42  
43 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod documented
44 #$data is an array of statements
45 0 my ($pkg,$data)=@_;
46 0 ▶ $pkg = ref $pkg || $pkg;
Condition0%0/3
ref $pkg || $pkg
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $pkg || $pkg
ref $pkg $pkg
Truth table0%0/3
A || B
A= ref $pkgB= $pkg
ABresult
1X1
011
000
47 0 my $self={};
48  
49 0 $self->{_data}=$data;
50 0 $self->{_position} = -1;
51 0 bless $self,$pkg;
52 }
53 0 ▶sub getFirst {
Subroutine getFirst: not called CC=1 SCAR=6.9
Pod documented
54 0 my $self = shift;
55 0 $self->{_position} = -1;
56 0 return $self->getNext
57 }
58 0 ▶sub getNext {
Subroutine getNext: not called CC=1 SCAR=6.9
Pod documented
59 0 my $self = shift;
60 0 $self->{_position} += 1;
61 0 return $self->{_data}->[$self->{_position}];
62 }
63 0 ▶sub close {
Subroutine close: not called CC=1 SCAR=6.9
Pod documented
64 0 $_[0]->{_data} = undef;
65 }
66  
67 1 1;
68 __END__
« Core/ModelSet.pm ↑ Summary Core.pm »