Clover Coverage Report
Coverage timestamp: Fri May 9 2008 10:54:27 EST
../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
22   70   8   4.4
6   46   0.36   5
5     1.6  
1    
 
  PhrasePositions       Line # 22 22 8 100% 1.0
 
  (48)
 
1    package org.apache.lucene.search;
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    import java.io.IOException;
20    import org.apache.lucene.index.*;
21   
 
22    final class PhrasePositions {
23    int doc; // current doc
24    int position; // position in doc
25    int count; // remaining pos in this doc
26    int offset; // position in phrase
27    TermPositions tp; // stream of positions
28    PhrasePositions next; // used to make lists
29   
 
30  479 toggle PhrasePositions(TermPositions t, int o) {
31  479 tp = t;
32  479 offset = o;
33    }
34   
 
35  1009 toggle final boolean next() throws IOException { // increments to next doc
36  1009 if (!tp.next()) {
37  149 tp.close(); // close stream
38  149 doc = Integer.MAX_VALUE; // sentinel value
39  149 return false;
40    }
41  860 doc = tp.doc();
42  860 position = 0;
43  860 return true;
44    }
45   
 
46  907 toggle final boolean skipTo(int target) throws IOException {
47  907 if (!tp.skipTo(target)) {
48  25 tp.close(); // close stream
49  25 doc = Integer.MAX_VALUE; // sentinel value
50  25 return false;
51    }
52  882 doc = tp.doc();
53  882 position = 0;
54  882 return true;
55    }
56   
57   
 
58  1447 toggle final void firstPosition() throws IOException {