Apache Lucene open-source search software
LUCENE-2638 Make HighFreqTerms.TermStats class public.
Andrzej Bialeckifa405589da49
diff --git a/lucene/contrib/CHANGES.txt b/lucene/contrib/CHANGES.txtindex 182e0df6762..eda238ca1b4 100644--- a/lucene/contrib/CHANGES.txt+++ b/lucene/contrib/CHANGES.txt@@ -36,6 +36,9 @@ API Changeswritten a custom RegexCapabilities it will need to be updatedto the new API. (Robert Muir, Uwe Schindler)+ * LUCENE-2638 MakeHighFreqTerms.TermStats public to make it more useful+ for API use. (Andrzej Bialecki)+======================= Lucene 3.x (not yet released) =======================Changes in backwards compatibility policydiff --git a/lucene/contrib/misc/src/java/org/apache/lucene/misc/HighFreqTerms.java b/lucene/contrib/misc/src/java/org/apache/lucene/misc/HighFreqTerms.javaindex e7c94800652..c0ac082f293 100644--- a/lucene/contrib/misc/src/java/org/apache/lucene/misc/HighFreqTerms.java+++ b/lucene/contrib/misc/src/java/org/apache/lucene/misc/HighFreqTerms.java@@ -231,30 +231,6 @@ final class TotalTermFreqComparatorSortDescending implements Comparator<TermStat}}-final class TermStats {- BytesRef termtext;- String field;- int docFreq;- long totalTermFreq;-- TermStats(String field, BytesRef termtext, int df) {- this.termtext = new BytesRef(termtext);- this.field = field;- this.docFreq = df;- }-- TermStats(String field, BytesRef termtext, int df, long tf) {- this.termtext = new BytesRef(termtext);- this.field = field;- this.docFreq = df;- this.totalTermFreq = tf;- }-- String getTermText() {- return termtext.utf8ToString();- }-}-/*** Priority queue for TermStats objects ordered by docFreq**/diff --git a/lucene/contrib/misc/src/java/org/apache/lucene/misc/TermStats.java b/lucene/contrib/misc/src/java/org/apache/lucene/misc/TermStats.javanew file mode 100644index 00000000000..b28fbdde436--- /dev/null+++ b/lucene/contrib/misc/src/java/org/apache/lucene/misc/TermStats.java@@ -0,0 +1,44 @@+package org.apache.lucene.misc;++/**+ * Licensed to the Apache Software Foundation (ASF) under one or more+ * contributor license agreements. See the NOTICE file distributed with+ * this work for additional information regarding copyright ownership.+ * The ASF licenses this file to You under the Apache License, Version 2.0+ * (the "License"); you may not use this file except in compliance with+ * the License. You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++import org.apache.lucene.util.BytesRef;++public final class TermStats {+ public BytesRef termtext;+ public String field;+ public int docFreq;+ public long totalTermFreq;++ TermStats(String field, BytesRef termtext, int df) {+ this.termtext = new BytesRef(termtext);+ this.field = field;+ this.docFreq = df;+ }++ TermStats(String field, BytesRef termtext, int df, long tf) {+ this.termtext = new BytesRef(termtext);+ this.field = field;+ this.docFreq = df;+ this.totalTermFreq = tf;+ }++ String getTermText() {+ return termtext.utf8ToString();+ }+}\ No newline at end of file