Apache Solr open-source search software
Removed some dead code and redundant javadoc. Fixed a few javadoc bugs.
Doug Cutting0aca5291dcda
diff --git a/src/java/org/apache/lucene/index/SegmentTermVector.java b/src/java/org/apache/lucene/index/SegmentTermVector.javaindex a558dd20dca..1a0ad78d709 100644--- a/src/java/org/apache/lucene/index/SegmentTermVector.java+++ b/src/java/org/apache/lucene/index/SegmentTermVector.java@@ -35,72 +35,23 @@ class SegmentTermVector implements TermFreqVector {return sb.toString();}-- public String toString(IndexReader ir)- throws IOException- {- return toString();- /*StringBuffer sb = new StringBuffer();- //TODO: Reimplement-- sb.append('{');- sb.append(field).append(": ");- for (int i=0; i<terms.length; i++) {- if (i>0) sb.append(", ");- Term t = ir.getTerm(terms[i]);- String text = t == null ? "UNKNOWN(" + i + ")" : t.text;- sb.append(text).append('/').append(termFreqs[i]);- if (termProx != null) appendTermProx(sb.append('/'), termProx[i]);- }- sb.append('}');- return sb.toString();*/- }--- /** Number of terms in the term vector. If there are no terms in the- * vector, returns 0.- */public int size() {return terms == null ? 0 : terms.length;}- /** Array of term numbers in ascending order. If there are no terms in- * the vector, returns null.- */public String [] getTerms() {return terms;}- /** Array of term frequencies. Locations of the array correspond one to one- * to the term numbers in the array obtained from <code>getTermNumbers</code>- * method. Each location in the array contains the number of times this- * term occurs in the document or the document field. If there are no terms in- * the vector, returns null.- */public int[] getTermFrequencies() {return termFreqs;}--- /** Return an index in the term numbers array returned from <code>getTermNumbers</code>- * at which the term with the specified <code>termNumber</code> appears. If this- * term does not appear in the array, return -1.- */public int indexOf(String termText) {int res = Arrays.binarySearch(terms, termText);return res >= 0 ? res : -1;}- /** Just like <code>indexOf(int)</code> but searches for a number of terms- * at the same time. Returns an array that has the same size as the number- * of terms searched for, each slot containing the result of searching for- * that term number. Array of term numbers must be sorted in ascending order.- *- * @param termNumbers array containing term numbers to look for- * @param start index in the array where the list of termNumbers starts- * @param len the number of termNumbers in the list- */public int[] indexesOf(String [] termNumbers, int start, int len) {// TODO: there must be a more efficient way of doing this.// At least, we could advance the lower bound of the terms arraydiff --git a/src/java/org/apache/lucene/index/TermFreqVector.java b/src/java/org/apache/lucene/index/TermFreqVector.javaindex aabb112c95c..d7465cdf208 100644--- a/src/java/org/apache/lucene/index/TermFreqVector.java+++ b/src/java/org/apache/lucene/index/TermFreqVector.java@@ -25,27 +25,17 @@ public interface TermFreqVector {/** Array of term frequencies. Locations of the array correspond one to one- * to the term numbers in the array obtained from <code>getTermNumbers</code>+ * to the terms in the array obtained from <code>getTerms</code>* method. Each location in the array contains the number of times this* term occurs in the document or the document field.*/public int[] getTermFrequencies();-- /** Return a string representation of the vector.- */- public String toString();--- /** Return a string representation of the vector, but use the provided IndexReader- * to obtain text for each term and include the text instead of term numbers.- */- public String toString(IndexReader ir) throws IOException;-- /** Return an index in the term numbers array returned from <code>getTermNumbers</code>- * at which the term with the specified <code>termNumber</code> appears. If this- * term does not appear in the array, return -1.+ /** Return an index in the term numbers array returned from+ * <code>getTerms</code> at which the term with the specified+ * <code>term</code> appears. If this term does not appear in the array,+ * return -1.*/public int indexOf(String term);diff --git a/src/java/org/apache/lucene/search/QueryTermVector.java b/src/java/org/apache/lucene/search/QueryTermVector.javaindex a0a1c7e8b0e..6d3f293ab87 100644--- a/src/java/org/apache/lucene/search/QueryTermVector.java+++ b/src/java/org/apache/lucene/search/QueryTermVector.java@@ -147,63 +147,23 @@ public class QueryTermVector implements TermFreqVector {}- /**- * @return The number of terms in the term vector.- */public int size() {return terms.length;}- /** Returns an array of positions in which the term is found or null if no position information is- * available or positions are not implemented.- * Terms are identified by the index at which its number appears in the- * term array obtained from <code>getTerms</code> method.- */- public int[] getTermPositions(int index) {- return null;- }-- /**- * @return An Array of term texts in ascending order.- */public String[] getTerms() {return terms;}- /** Array of term frequencies. Locations of the array correspond one to one- * to the term numbers in the array obtained from <code>getTermNumbers</code>- * method. Each location in the array contains the number of times this- * term occurs in the document or the document field.- */public int[] getTermFrequencies() {return termFreqs;}- /** Return a string representation of the vector, but use the provided IndexReader- * to obtain text for each term and include the text instead of term numbers.- */- public String toString(IndexReader ir) throws IOException {- return toString();- }-- /** Return an index in the term numbers array returned from <code>getTermNumbers</code>- * at which the term with the specified <code>termNumber</code> appears. If this- * term does not appear in the array, return -1.- */public int indexOf(String term) {int res = Arrays.binarySearch(terms, term);return res >= 0 ? res : -1;}- /** Just like <code>indexOf(int)</code> but searches for a number of terms- * at the same time. Returns an array that has the same size as the number- * of terms searched for, each slot containing the result of searching for- * that term number.- *- * @param terms array containing terms to look for- * @param start index in the array where the list of terms starts- * @param len the number of terms in the list- */public int[] indexesOf(String[] terms, int start, int len) {int res[] = new int[len];