File Coverage

blib/lib/Plucene/Index/TermInfo.pm
Criterion Covered Total %
statement 14 17 82.3
branch n/a
condition n/a
subroutine 5 6 83.3
pod 2 2 100.0
total 21 25 84.0


line stmt bran cond sub pod time code
1             package Plucene::Index::TermInfo;
2              
3             =head1 NAME
4              
5             Plucene::Index::TermInfo - Information on an index term
6              
7             =head1 SYNOPSIS
8              
9             my $term_info = Plucene::Index::TermInfo->new({
10             doc_freq => $doc_freq,
11             freq_pointer => $freq_pointer,
12             prox_pointer => $prox_pointer,
13             });
14              
15             =head1 DESCRIPTION
16              
17             This class holds information about an index term.
18              
19             =head1 METHODS
20              
21             =cut
22              
23 19     19   110 use strict;
  19         37  
  19         642  
24 19     19   103 use warnings;
  19         40  
  19         564  
25              
26 19     19   102 use Carp;
  19         36  
  19         1303  
27              
28 19     19   110 use base 'Class::Accessor::Fast';
  19         33  
  19         4108  
29              
30             =head2 doc_freq / freq_pointer / prox_pointer
31              
32             Get / set term info.
33              
34             =cut
35              
36             __PACKAGE__->mk_accessors(qw( doc_freq freq_pointer prox_pointer ));
37              
38             =head2 copy_in / clone
39              
40             $term_info1->copy_in($term_info2);
41              
42             my $term_info1 = $term_info2->clone;
43              
44             These will make $term_info1 be the same as $term_info2.
45            
46             =cut
47              
48             sub copy_in {
49 0     0 1 0 my ($self, $other) = @_;
50 0         0 %$self = %$other;
51 0         0 return $self;
52             }
53              
54             sub clone {
55 80729     80729 1 286878 my $self = shift;
56 80729         578924 return bless {%$self} => ref $self;
57             }
58              
59             1;