2 * Copyright 2005 The Apache Software Foundation
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 namespace Lucene
.Net
.Search
21 public class SimilarityDelegator
: Similarity
24 private Similarity delegee
;
26 /// <summary>Construct a {@link Similarity} that delegates all methods to another.
29 /// <param name="delegee">the Similarity implementation to delegate to
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
);