File Coverage

blib/lib/ODO/Vocabulary.pm
Criterion Covered Total %
statement 12 21 57.1
branch 0 4 0.0
condition n/a
subroutine 4 7 57.1
pod 1 3 33.3
total 17 35 48.5


line stmt bran cond sub pod time code
1             #
2             # Copyright (c) 2007 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/Vocabulary.pm,v $
10             # Created by: Stephen Evanchik( evanchik@us.ibm.com )
11             # Created on: 01/15/2007
12             # Revision: $Id: Vocabulary.pm,v 1.2 2009-11-25 17:46:52 ubuntu Exp $
13             #
14             # Contributors:
15             # IBM Corporation - initial API and implementation
16             #
17             package ODO::Vocabulary;
18              
19 3     3   17 use strict;
  3         4  
  3         80  
20 3     3   13 use warnings;
  3         8  
  3         79  
21              
22 3     3   13 use base qw/ODO/;
  3         6  
  3         205  
23 3     3   17 use vars qw /$VERSION/;
  3         5  
  3         825  
24             $VERSION = sprintf "%d.%02d", q$Revision: 1.2 $ =~ /: (\d+)\.(\d+)/;
25              
26             __PACKAGE__->mk_ro_accessors(qw/uri_map_table/);
27              
28             sub uri_to_node {
29 0     0 0   my ($self, $uri) = @_;
30            
31 0 0         $self = $self->new()
32             unless(ref $self);
33            
34 0           return $self->uri_map_table()->{'nodes'}->{ $uri };
35             }
36              
37             sub uri_to_name {
38 0     0 0   my ($self, $uri) = @_;
39            
40 0 0         $self = $self->new()
41             unless(ref $self);
42            
43 0           return $self->uri_map_table()->{'names'}->{ $uri };
44             }
45             sub init {
46 0     0 1   my ($self, $config) = @_;
47 0           $self->{'uri_map_table'} = {'nodes'=> {}, 'names'=> {}};
48 0           return $self;
49             }
50              
51             1;
52              
53             __END__