Clover Coverage Report
Coverage timestamp: Fri May 9 2008 10:54:27 EST
../../../../img/srcFileCovDistChart3.png 83% of files have more coverage
7   58   7   1
0   25   1   7
7     1  
1    
 
  SimilarityDelegator       Line # 22 7 7 28.6% 0.2857143
 
  (38)
 
1    package org.apache.lucene.search;
2   
3    /**
4    * Copyright 2005 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    /** Expert: Delegating scoring implementation. Useful in {@link
20    * Query#getSimilarity(Searcher)} implementations, to override only certain
21    * methods of a Searcher's Similiarty implementation.. */
 
22    public class SimilarityDelegator extends Similarity {
23   
24    private Similarity delegee;
25   
26    /** Construct a {@link Similarity} that delegates all methods to another.
27    *
28    * @param delegee the Similarity implementation to delegate to
29    */
 
30  27598 toggle public SimilarityDelegator(Similarity delegee) {
31  27598 this.delegee = delegee;
32    }
33   
 
34  0 toggle public float lengthNorm(String fieldName, int numTerms) {
35  0 return delegee.lengthNorm(fieldName, numTerms);
36    }
37   
 
38  10242 toggle public float queryNorm(float sumOfSquaredWeights) {
39  10242 return delegee.queryNorm(sumOfSquaredWeights);
40    }
41   
 
42  0 toggle public float tf(float freq) {
43  0 return delegee.tf(freq);
44    }
45   
 
46  0 toggle public float sloppyFreq(int distance) {
47  0 return delegee.sloppyFreq(distance);
48    }
49   
 
50  0 toggle public float idf(int docFreq, int numDocs) {
51  0 return delegee.idf(docFreq, numDocs);
52    }
53   
 
54  0 toggle public float coord(int overlap, int maxOverlap) {
55  0 return delegee.coord(overlap, maxOverlap);
56    }
57   
58    }