Clover Coverage Report
Coverage timestamp: Fri May 9 2008 10:54:27 EST
../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
62   154   32   5.17
34   107   0.52   12
12     2.67  
1    
 
  PhraseScorer       Line # 23 62 32 97.2% 0.9722222
 
  (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   
21    import org.apache.lucene.index.*;
22   
 
23    abstract class PhraseScorer extends Scorer {
24    private Weight weight;
25    protected byte[] norms;
26    protected float value;
27   
28    private boolean firstTime = true;
29    private boolean more = true;
30    protected PhraseQueue pq;
31    protected PhrasePositions first, last;
32   
33    private float freq;
34   
35   
 
36  230 toggle PhraseScorer(Weight weight, TermPositions[] tps, int[] positions, Similarity similarity,
37    byte[] norms) {
38  230 super(similarity);
39  230 this.norms = norms;
40  230 this.weight = weight;
41  230 this.value = weight.getValue();
42   
43    // convert tps to a list
44  709 for (int i = 0; i < tps.length; i++) {
45  479 PhrasePositions pp = new PhrasePositions(tps[i], positions[i]);
46  479 if (last != null) { // add next to end of list
47  249 last.next = pp;
48    } else
49