~ubuntu-branches/ubuntu/raring/clucene-core/raring-proposed

« back to all changes in this revision

Viewing changes to src/CLucene/index/TermInfo.cpp

  • Committer: Package Import Robot
  • Author(s): Fathi Boudra
  • Date: 2012-08-11 09:33:38 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120811093338-fgrx41ftqew3qt6a
Tags: 2.3.3.4-1
* New upstream release (Closes: #661703).
* Convert package to multiarch.
* Drop obsolete patches:
  - 01_add_missing_include_bug505667.diff
  - 02_posixness_fix_bug530308.diff
* Add patches:
  - Fixing_ZLIB_configuration_in_shared_CMakeLists.patch
  - Fix-pkgconfig-file-by-adding-clucene-shared-library.patch
  - Install-contribs-lib.patch
  - multiarch.patch
* Update debian/compat: bump to 8.
* Update debian/control:
  - update build dependencies (add cmake, libboost-dev and libz-dev).
  - bump Standards-Version to 3.9.3.
  - rename packages due to ABI bump: libclucene0ldbl -> libclucene-core1.
  - add libclucene-contribs1 package.
* Update debian/rules:
  - rewrite to use CMake.
  - add multiarch support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*------------------------------------------------------------------------------
2
 
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
3
 
4
 
* Distributable under the terms of either the Apache License (Version 2.0) or 
5
 
* the GNU Lesser General Public License, as specified in the COPYING file.
6
 
------------------------------------------------------------------------------*/
7
 
#include "CLucene/StdHeader.h"
8
 
#include "TermInfo.h"
9
 
 
10
 
 
11
 
CL_NS_DEF(index)
12
 
 
13
 
TermInfo::TermInfo(){
14
 
//Func - Constructor
15
 
//Pre  - true
16
 
//Post - Instance has been created
17
 
                        
18
 
        docFreq     = 0;
19
 
        freqPointer = 0;
20
 
        proxPointer = 0;
21
 
  skipOffset = 0;
22
 
}
23
 
 
24
 
TermInfo::~TermInfo(){
25
 
//Func - Destructor.
26
 
//Pre  - true
27
 
//Post - Instance has been destroyed
28
 
}
29
 
 
30
 
TermInfo::TermInfo(const int32_t df, const int64_t fp, const int64_t pp){
31
 
//Func - Constructor. 
32
 
//Pre  - df >= 0, fp >= 0 pp >= 0
33
 
//Post - An instance has been created with FreqPointer = fp, proxPointer=pp and docFreq= df
34
 
 
35
 
    CND_PRECONDITION(df >= 0, "df contains negative number");
36
 
    CND_PRECONDITION(fp >= 0, "fp contains negative number");
37
 
    CND_PRECONDITION(pp >= 0, "pp contains negative number");
38
 
 
39
 
    freqPointer = fp;
40
 
    proxPointer = pp;
41
 
          docFreq     = df;
42
 
    skipOffset = 0;
43
 
}
44
 
 
45
 
TermInfo::TermInfo(const TermInfo* ti) {
46
 
//Func - Constructor. 
47
 
//       Initialises this instance by copying the values of another TermInfo ti
48
 
//Pre  - ti is a reference to another TermInfo
49
 
//       ti->docFreq >= 0
50
 
//       ti->freqPointer >= 0
51
 
//       ti->proxPointer >= 0
52
 
//Post - Values of ti have been copied to the values of this Instance.
53
 
 
54
 
    CND_PRECONDITION(ti->docFreq     >= 0, "ti->docFreq contains negative number");
55
 
    CND_PRECONDITION(ti->freqPointer >= 0, "ti->freqPointer contains negative number");
56
 
    CND_PRECONDITION(ti->proxPointer >= 0, "ti->proxPointer contains negative number");
57
 
 
58
 
        docFreq     = ti->docFreq;
59
 
        freqPointer = ti->freqPointer;
60
 
        proxPointer = ti->proxPointer;
61
 
  skipOffset  = ti->skipOffset;
62
 
}
63
 
 
64
 
void TermInfo::set(const int32_t df, const int64_t fp, const int64_t pp, int32_t so) {
65
 
//Func - Sets a new document frequency, a new freqPointer and a new proxPointer
66
 
//Pre  - df >= 0, fp >= 0 pp >= 0
67
 
//Post - The new document frequency, a new freqPointer and a new proxPointer
68
 
//       have been set
69
 
 
70
 
    CND_PRECONDITION(df >= 0, "df contains negative number");
71
 
    CND_PRECONDITION(fp >= 0, "fp contains negative number");
72
 
    CND_PRECONDITION(pp >= 0, "pp contains negative number");
73
 
 
74
 
        docFreq     = df;
75
 
        freqPointer = fp;
76
 
        proxPointer = pp;
77
 
    skipOffset  = so;
78
 
}
79
 
 
80
 
void TermInfo::set(const TermInfo* ti) {
81
 
//Func - Sets a new document frequency, a new freqPointer and a new proxPointer
82
 
//       by copying these values from another instance of TermInfo
83
 
//Pre  - ti is a reference to another TermInfo
84
 
//       ti->docFreq >= 0
85
 
//       ti->freqPointer >= 0
86
 
//       ti->proxPointer >= 0
87
 
//Post - Values of ti have been copied to the values of this Instance.
88
 
 
89
 
    CND_PRECONDITION(ti->docFreq     >= 0, "ti->docFreq contains negative number");
90
 
    CND_PRECONDITION(ti->freqPointer >= 0, "ti->freqPointer contains negative number");
91
 
    CND_PRECONDITION(ti->proxPointer >= 0, "ti->proxPointer contains negative number");
92
 
 
93
 
        docFreq     = ti->docFreq;
94
 
        freqPointer = ti->freqPointer;
95
 
        proxPointer = ti->proxPointer;
96
 
    skipOffset =  ti->skipOffset;
97
 
}
98
 
CL_NS_END