2006-09-10 Francisco Javier F. Serrador <serrador@openshine.com>
[beagle.git] / beagled / Lucene.Net / Search / SimilarityDelegator.cs
blobaf9f8bbb9d794beb22d6d5fae0a3ef2bf98af8e6
1 /*
2 * Copyright 2005 The Apache Software Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 using System;
17 namespace Lucene.Net.Search
20 [Serializable]
21 public class SimilarityDelegator : Similarity
24 private Similarity delegee;
26 /// <summary>Construct a {@link Similarity} that delegates all methods to another.
27 ///
28 /// </summary>
29 /// <param name="delegee">the Similarity implementation to delegate to
30 /// </param>
31 public SimilarityDelegator(Similarity delegee)
33 this.delegee = delegee;
36 public override float LengthNorm(System.String fieldName, int numTerms)
38 return delegee.LengthNorm(fieldName, numTerms);
41 public override float QueryNorm(float sumOfSquaredWeights)
43 return delegee.QueryNorm(sumOfSquaredWeights);
46 public override float Tf(float freq)
48 return delegee.Tf(freq);
51 public override float SloppyFreq(int distance)
53 return delegee.SloppyFreq(distance);
56 public override float Idf(int docFreq, int numDocs)
58 return delegee.Idf(docFreq, numDocs);
61 public override float Coord(int overlap, int maxOverlap)
63 return delegee.Coord(overlap, maxOverlap);