KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lucene > index > TermInfo


1 package org.apache.lucene.index;
2
3 /**
4  * Copyright 2004 The Apache Software Foundation
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 /** A TermInfo is the record of information stored for a term.*/
20
21 final class TermInfo {
22   /** The number of documents which contain the term. */
23   int docFreq = 0;
24
25   long freqPointer = 0;
26   long proxPointer = 0;
27   int skipOffset;
28
29   TermInfo() {}
30
31   TermInfo(int df, long fp, long pp) {
32     docFreq = df;
33     freqPointer = fp;
34     proxPointer = pp;
35   }
36
37   TermInfo(TermInfo ti) {
38     docFreq = ti.docFreq;
39     freqPointer = ti.freqPointer;
40     proxPointer = ti.proxPointer;
41     skipOffset = ti.skipOffset;
42   }
43
44   final void set(int docFreq,
45                  long freqPointer, long proxPointer, int skipOffset) {
46     this.docFreq = docFreq;
47     this.freqPointer = freqPointer;
48     this.proxPointer = proxPointer;
49     this.skipOffset = skipOffset;
50   }
51
52   final void set(TermInfo ti) {
53     docFreq = ti.docFreq;
54     freqPointer = ti.freqPointer;
55     proxPointer = ti.proxPointer;
56     skipOffset = ti.skipOffset;
57   }
58 }
59
Popular Tags