lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r831094 [6/8] - in /lucene/java/branches/flex_1458: ./ contrib/ contrib/analyzers/common/src/java/org/apache/lucene/analysis/br/ contrib/analyzers/common/src/java/org/apache/lucene/analysis/cz/ contrib/analyzers/common/src/java/org/apache/l...
Date Thu, 29 Oct 2009 21:29:56 GMT
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiSearcher.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiSearcher.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiSearcher.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiSearcher.java Thu Oct 29 21:29:47 2009
@@ -52,6 +52,7 @@
       setSimilarity(similarity);
     }
 
+    @Override
     public int docFreq(Term term) {
       int df;
       try {
@@ -63,6 +64,7 @@
       return df;
     }
 
+    @Override
     public int[] docFreqs(Term[] terms) {
       int[] result = new int[terms.length];
       for (int i = 0; i < terms.length; i++) {
@@ -71,10 +73,12 @@
       return result;
     }
 
+    @Override
     public int maxDoc() {
       return maxDoc;
     }
 
+    @Override
     public Query rewrite(Query query) {
       // this is a bit of a hack. We know that a query which
       // creates a Weight based on this Dummy-Searcher is
@@ -83,10 +87,12 @@
       return query;
     }
 
+    @Override
     public void close() {
       throw new UnsupportedOperationException();
     }
 
+    @Override
     public Document doc(int i) {
       throw new UnsupportedOperationException();
     }
@@ -95,18 +101,22 @@
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public Explanation explain(Weight weight,int doc) {
       throw new UnsupportedOperationException();
     }
 
+    @Override
     public void search(Weight weight, Filter filter, Collector results) {
       throw new UnsupportedOperationException();
     }
     
+    @Override
     public TopDocs search(Weight weight,Filter filter,int n) {
       throw new UnsupportedOperationException();
     }
 
+    @Override
     public TopFieldDocs search(Weight weight,Filter filter,int n,Sort sort) {
       throw new UnsupportedOperationException();
     }
@@ -138,11 +148,13 @@
   }
 
   // inherit javadoc
+  @Override
   public void close() throws IOException {
     for (int i = 0; i < searchables.length; i++)
       searchables[i].close();
   }
 
+  @Override
   public int docFreq(Term term) throws IOException {
     int docFreq = 0;
     for (int i = 0; i < searchables.length; i++)
@@ -151,6 +163,7 @@
   }
 
   // inherit javadoc
+  @Override
   public Document doc(int n) throws CorruptIndexException, IOException {
     int i = subSearcher(n);			  // find searcher index
     return searchables[i].doc(n - starts[i]);	  // dispatch to searcher
@@ -174,10 +187,12 @@
     return n - starts[subSearcher(n)];
   }
 
+  @Override
   public int maxDoc() throws IOException {
     return maxDoc;
   }
 
+  @Override
   public TopDocs search(Weight weight, Filter filter, int nDocs)
       throws IOException {
 
@@ -205,6 +220,7 @@
     return new TopDocs(totalHits, scoreDocs, maxScore);
   }
 
+  @Override
   public TopFieldDocs search (Weight weight, Filter filter, int n, Sort sort)
   throws IOException {
     FieldDocSortedHitQueue hq = null;
@@ -247,6 +263,7 @@
   }
 
   // inherit javadoc
+  @Override
   public void search(Weight weight, Filter filter, final Collector collector)
   throws IOException {
     for (int i = 0; i < searchables.length; i++) {
@@ -254,15 +271,19 @@
       final int start = starts[i];
       
       final Collector hc = new Collector() {
+        @Override
         public void setScorer(Scorer scorer) throws IOException {
           collector.setScorer(scorer);
         }
+        @Override
         public void collect(int doc) throws IOException {
           collector.collect(doc);
         }
+        @Override
         public void setNextReader(IndexReader reader, int docBase) throws IOException {
           collector.setNextReader(reader, start + docBase);
         }
+        @Override
         public boolean acceptsDocsOutOfOrder() {
           return collector.acceptsDocsOutOfOrder();
         }
@@ -272,6 +293,7 @@
     }
   }
 
+  @Override
   public Query rewrite(Query original) throws IOException {
     Query[] queries = new Query[searchables.length];
     for (int i = 0; i < searchables.length; i++) {
@@ -280,6 +302,7 @@
     return queries[0].combine(queries);
   }
 
+  @Override
   public Explanation explain(Weight weight, int doc) throws IOException {
     int i = subSearcher(doc);			  // find searcher index
     return searchables[i].explain(weight, doc - starts[i]); // dispatch to searcher
@@ -300,6 +323,7 @@
    *
    * @return rewritten queries
    */
+  @Override
   protected Weight createWeight(Query original) throws IOException {
     // step 1
     Query rewrittenQuery = rewrite(original);

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQuery.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQuery.java Thu Oct 29 21:29:47 2009
@@ -67,6 +67,7 @@
   }
 
   private static final class ConstantScoreFilterRewrite extends RewriteMethod implements Serializable {
+    @Override
     public Query rewrite(IndexReader reader, MultiTermQuery query) {
       Query result = new ConstantScoreQuery(new MultiTermQueryWrapperFilter<MultiTermQuery>(query));
       result.setBoost(query.getBoost());
@@ -94,6 +95,7 @@
   public final static RewriteMethod CONSTANT_SCORE_FILTER_REWRITE = new ConstantScoreFilterRewrite();
 
   private static class ScoringBooleanQueryRewrite extends RewriteMethod implements Serializable {
+    @Override
     public Query rewrite(IndexReader reader, MultiTermQuery query) throws IOException {
 
       FilteredTermsEnum termsEnum = query.getTermsEnum(reader);
@@ -163,6 +165,7 @@
   public final static RewriteMethod SCORING_BOOLEAN_QUERY_REWRITE = new ScoringBooleanQueryRewrite();
 
   private static class ConstantScoreBooleanQueryRewrite extends ScoringBooleanQueryRewrite implements Serializable {
+    @Override
     public Query rewrite(IndexReader reader, MultiTermQuery query) throws IOException {
       // strip the scores off
       Query result = new ConstantScoreQuery(new QueryWrapperFilter(super.rewrite(reader, query)));
@@ -171,6 +174,7 @@
     }
 
     // Make sure we are still a singleton even after deserializing
+    @Override
     protected Object readResolve() {
       return CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE;
     }
@@ -237,6 +241,7 @@
       return docCountPercent;
     }
 
+    @Override
     public Query rewrite(IndexReader reader, MultiTermQuery query) throws IOException {
 
       // Get the enum and start visiting terms.  If we
@@ -449,6 +454,7 @@
     numberOfTerms += inc;
   }
 
+  @Override
   public Query rewrite(IndexReader reader) throws IOException {
     return rewriteMethod.rewrite(reader, this);
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java Thu Oct 29 21:29:47 2009
@@ -177,6 +177,7 @@
         // fill into a OpenBitSet
         final OpenBitSet bitSet = new OpenBitSet(reader.maxDoc());
         new TermGenerator() {
+          @Override
           public void handleDoc(int doc) {
             bitSet.set(doc);
           }
@@ -194,6 +195,7 @@
         // else fill into a OpenBitSet
         final OpenBitSet bitSet = new OpenBitSet(reader.maxDoc());
         new TermGenerator() {
+          @Override
           public void handleDoc(int doc) {
             bitSet.set(doc);
           }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ParallelMultiSearcher.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ParallelMultiSearcher.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ParallelMultiSearcher.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ParallelMultiSearcher.java Thu Oct 29 21:29:47 2009
@@ -32,7 +32,7 @@
 
   private Searchable[] searchables;
   private int[] starts;
-	
+
   /** Creates a searchable which searches <i>searchables</i>. */
   public ParallelMultiSearcher(Searchable... searchables) throws IOException {
     super(searchables);
@@ -43,6 +43,7 @@
   /**
    * TODO: parallelize this one too
    */
+  @Override
   public int docFreq(Term term) throws IOException {
     return super.docFreq(term);
   }
@@ -52,6 +53,7 @@
    * Searchable, waits for each search to complete and merge
    * the results back together.
    */
+  @Override
   public TopDocs search(Weight weight, Filter filter, int nDocs)
     throws IOException {
     HitQueue hq = new HitQueue(nDocs, false);
@@ -97,6 +99,7 @@
    * Searchable, waits for each search to complete and merges
    * the results back together.
    */
+  @Override
   public TopFieldDocs search(Weight weight, Filter filter, int nDocs, Sort sort)
     throws IOException {
     // don't specify the fields - we'll wait to do this until we get results
@@ -153,6 +156,7 @@
   * 
   * TODO: parallelize this one too
   */
+  @Override
   public void search(Weight weight, Filter filter, final Collector collector)
    throws IOException {
    for (int i = 0; i < searchables.length; i++) {
@@ -160,15 +164,22 @@
      final int start = starts[i];
 
      final Collector hc = new Collector() {
+       @Override
        public void setScorer(Scorer scorer) throws IOException {
          collector.setScorer(scorer);
        }
+       
+       @Override
        public void collect(int doc) throws IOException {
          collector.collect(doc);
        }
+       
+       @Override
        public void setNextReader(IndexReader reader, int docBase) throws IOException {
          collector.setNextReader(reader, start + docBase);
        }
+       
+       @Override
        public boolean acceptsDocsOutOfOrder() {
          return collector.acceptsDocsOutOfOrder();
        }
@@ -176,12 +187,13 @@
      
      searchables[i].search(weight, filter, hc);
    }
- }
+  }
 
   /*
    * TODO: this one could be parallelized too
    * @see org.apache.lucene.search.Searchable#rewrite(org.apache.lucene.search.Query)
    */
+  @Override
   public Query rewrite(Query original) throws IOException {
     return super.rewrite(original);
   }
@@ -230,6 +242,7 @@
     this.sort = sort;
   }
 
+  @Override
   @SuppressWarnings ("unchecked")
   public void run() {
     try {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PhraseQuery.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PhraseQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PhraseQuery.java Thu Oct 29 21:29:47 2009
@@ -125,22 +125,29 @@
       idf = idfExp.getIdf();
     }
 
+    @Override
     public String toString() { return "weight(" + PhraseQuery.this + ")"; }
 
+    @Override
     public Query getQuery() { return PhraseQuery.this; }
+
+    @Override
     public float getValue() { return value; }
 
+    @Override
     public float sumOfSquaredWeights() {
       queryWeight = idf * getBoost();             // compute query weight
       return queryWeight * queryWeight;           // square it
     }
 
+    @Override
     public void normalize(float queryNorm) {
       this.queryNorm = queryNorm;
       queryWeight *= queryNorm;                   // normalize query weight
       value = queryWeight * idf;                  // idf for document 
     }
 
+    @Override
     public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException {
       if (terms.size() == 0)			  // optimize zero-term case
         return null;
@@ -168,6 +175,7 @@
 
     }
 
+    @Override
     public Explanation explain(IndexReader reader, int doc)
       throws IOException {
 
@@ -215,12 +223,17 @@
       fieldExpl.setDescription("fieldWeight("+field+":"+query+" in "+doc+
                                "), product of:");
 
-      Scorer scorer = scorer(reader, true, false);
+      PhraseScorer scorer = (PhraseScorer) scorer(reader, true, false);
       if (scorer == null) {
         return new Explanation(0.0f, "no matching docs");
       }
-      Explanation tfExpl = scorer.explain(doc);
-      fieldExpl.addDetail(tfExpl);
+      Explanation tfExplanation = new Explanation();
+      int d = scorer.advance(doc);
+      float phraseFreq = (d == doc) ? scorer.currentFreq() : 0.0f;
+      tfExplanation.setValue(similarity.tf(phraseFreq));
+      tfExplanation.setDescription("tf(phraseFreq=" + phraseFreq + ")");
+      
+      fieldExpl.addDetail(tfExplanation);
       fieldExpl.addDetail(idfExpl);
 
       Explanation fieldNormExpl = new Explanation();
@@ -231,7 +244,7 @@
       fieldNormExpl.setDescription("fieldNorm(field="+field+", doc="+doc+")");
       fieldExpl.addDetail(fieldNormExpl);
 
-      fieldExpl.setValue(tfExpl.getValue() *
+      fieldExpl.setValue(tfExplanation.getValue() *
                          idfExpl.getValue() *
                          fieldNormExpl.getValue());
 
@@ -247,6 +260,7 @@
     }
   }
 
+  @Override
   public Weight createWeight(Searcher searcher) throws IOException {
     if (terms.size() == 1) {			  // optimize one-term case
       Term term = terms.get(0);
@@ -260,11 +274,13 @@
   /**
    * @see org.apache.lucene.search.Query#extractTerms(Set)
    */
+  @Override
   public void extractTerms(Set<Term> queryTerms) {
     queryTerms.addAll(terms);
   }
 
   /** Prints a user-readable version of this query. */
+  @Override
   public String toString(String f) {
     StringBuilder buffer = new StringBuilder();
     if (field != null && !field.equals(f)) {
@@ -308,6 +324,7 @@
   }
 
   /** Returns true iff <code>o</code> is equal to this. */
+  @Override
   public boolean equals(Object o) {
     if (!(o instanceof PhraseQuery))
       return false;
@@ -319,6 +336,7 @@
   }
 
   /** Returns a hash code value for this object.*/
+  @Override
   public int hashCode() {
     return Float.floatToIntBits(getBoost())
       ^ slop

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PhraseQueue.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PhraseQueue.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PhraseQueue.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PhraseQueue.java Thu Oct 29 21:29:47 2009
@@ -24,6 +24,7 @@
     initialize(size);
   }
 
+  @Override
   protected final boolean lessThan(PhrasePositions pp1, PhrasePositions pp2) {
     if (pp1.doc == pp2.doc) 
       if (pp1.position == pp2.position)

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PhraseScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PhraseScorer.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PhraseScorer.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PhraseScorer.java Thu Oct 29 21:29:47 2009
@@ -69,8 +69,10 @@
     first.doc = -1;
   }
 
+  @Override
   public int docID() { return first.doc; }
 
+  @Override
   public int nextDoc() throws IOException {
     if (firstTime) {
       init();
@@ -104,12 +106,14 @@
     return false;                                 // no more matches
   }
 
+  @Override
   public float score() throws IOException {
     //System.out.println("scoring " + first.doc);
     float raw = getSimilarity().tf(freq) * value; // raw score
     return norms == null ? raw : raw * Similarity.decodeNorm(norms[first.doc]); // normalize
   }
 
+  @Override
   public int advance(int target) throws IOException {
     firstTime = false;
     for (PhrasePositions pp = first; more && pp != null; pp = pp.next) {
@@ -125,6 +129,11 @@
   }
   
   /**
+   * phrase frequency in current doc as computed by phraseFreq().
+   */
+  public final float currentFreq() { return freq; }
+  
+  /**
    * For a document containing all the phrase query terms, compute the
    * frequency of the phrase in that document. 
    * A non zero frequency means a match.
@@ -170,17 +179,7 @@
     last.next = null;
   }
 
-  public Explanation explain(final int doc) throws IOException {
-    Explanation tfExplanation = new Explanation();
-
-    int d = advance(doc);
-    float phraseFreq = (d == doc) ? freq : 0.0f;
-    tfExplanation.setValue(getSimilarity().tf(phraseFreq));
-    tfExplanation.setDescription("tf(phraseFreq=" + phraseFreq + ")");
-
-    return tfExplanation;
-  }
-
+  @Override
   public String toString() { return "scorer(" + weight + ")"; }
 
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PositiveScoresOnlyCollector.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PositiveScoresOnlyCollector.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PositiveScoresOnlyCollector.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PositiveScoresOnlyCollector.java Thu Oct 29 21:29:47 2009
@@ -35,16 +35,19 @@
     this.c = c;
   }
   
+  @Override
   public void collect(int doc) throws IOException {
     if (scorer.score() > 0) {
       c.collect(doc);
     }
   }
 
+  @Override
   public void setNextReader(IndexReader reader, int docBase) throws IOException {
     c.setNextReader(reader, docBase);
   }
 
+  @Override
   public void setScorer(Scorer scorer) throws IOException {
     // Set a ScoreCachingWrappingScorer in case the wrapped Collector will call
     // score() also.
@@ -52,6 +55,7 @@
     c.setScorer(this.scorer);
   }
 
+  @Override
   public boolean acceptsDocsOutOfOrder() {
     return c.acceptsDocsOutOfOrder();
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PrefixFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PrefixFilter.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PrefixFilter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PrefixFilter.java Thu Oct 29 21:29:47 2009
@@ -32,6 +32,7 @@
   public Term getPrefix() { return query.getPrefix(); }
 
   /** Prints a user-readable version of this query. */
+  @Override
   public String toString () {
     StringBuilder buffer = new StringBuilder();
     buffer.append("PrefixFilter(");

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PrefixQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PrefixQuery.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PrefixQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PrefixQuery.java Thu Oct 29 21:29:47 2009
@@ -40,6 +40,13 @@
   /** Returns the prefix of this query. */
   public Term getPrefix() { return prefix; }
   
+  // deprecated
+  @Override
+  protected FilteredTermEnum getEnum(IndexReader reader) throws IOException {
+    return new PrefixTermEnum(reader, prefix);
+  }
+  
+  @Override  
   protected FilteredTermsEnum getTermsEnum(IndexReader reader) throws IOException {
     return new PrefixTermsEnum(reader, prefix);
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PrefixTermEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PrefixTermEnum.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PrefixTermEnum.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PrefixTermEnum.java Thu Oct 29 21:29:47 2009
@@ -42,10 +42,12 @@
     setEnum(reader.terms(new Term(prefix.field(), prefix.text())));
   }
 
+  @Override
   public float difference() {
     return 1.0f;
   }
 
+  @Override
   protected boolean endEnum() {
     return endEnum;
   }
@@ -54,6 +56,7 @@
       return prefix;
   }
 
+  @Override
   protected boolean termCompare(Term term) {
     if (term.field() == prefix.field() && term.text().startsWith(prefix.text())) {                                                                              
       return true;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Query.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Query.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Query.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Query.java Thu Oct 29 21:29:47 2009
@@ -78,6 +78,7 @@
   public abstract String toString(String field);
 
   /** Prints a query to a string. */
+  @Override
   public String toString() {
     return toString("");
   }
@@ -204,6 +205,7 @@
   }
 
   /** Returns a clone of this query. */
+  @Override
   public Object clone() {
     try {
       return super.clone();
@@ -212,6 +214,7 @@
     }
   }
 
+  @Override
   public int hashCode() {
     final int prime = 31;
     int result = 1;
@@ -219,6 +222,7 @@
     return result;
   }
 
+  @Override
   public boolean equals(Object obj) {
     if (this == obj)
       return true;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/QueryTermVector.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/QueryTermVector.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/QueryTermVector.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/QueryTermVector.java Thu Oct 29 21:29:47 2009
@@ -106,6 +106,7 @@
     }
   }
   
+  @Override
   public final String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append('{');

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ReqExclScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ReqExclScorer.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ReqExclScorer.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ReqExclScorer.java Thu Oct 29 21:29:47 2009
@@ -41,6 +41,7 @@
     this.exclDisi = exclDisi;
   }
 
+  @Override
   public int nextDoc() throws IOException {
     if (reqScorer == null) {
       return doc;
@@ -88,6 +89,7 @@
     return NO_MORE_DOCS;
   }
 
+  @Override
   public int docID() {
     return doc;
   }
@@ -96,10 +98,12 @@
    * Initially invalid, until {@link #next()} is called the first time.
    * @return The score of the required scorer.
    */
+  @Override
   public float score() throws IOException {
     return reqScorer.score(); // reqScorer may be null when next() or skipTo() already return false
   }
   
+  @Override
   public int advance(int target) throws IOException {
     if (reqScorer == null) {
       return doc = NO_MORE_DOCS;
@@ -113,15 +117,4 @@
     }
     return doc = toNonExcluded();
   }
-  
-  public Explanation explain(int doc) throws IOException {
-    Explanation res = new Explanation();
-    if (exclDisi.advance(doc) == doc) {
-      res.setDescription("excluded");
-    } else {
-      res.setDescription("not excluded");
-      res.addDetail(reqScorer.explain(doc));
-    }
-    return res;
-  }
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ReqOptSumScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ReqOptSumScorer.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ReqOptSumScorer.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ReqOptSumScorer.java Thu Oct 29 21:29:47 2009
@@ -43,14 +43,17 @@
     this.optScorer = optScorer;
   }
 
+  @Override
   public int nextDoc() throws IOException {
     return reqScorer.nextDoc();
   }
   
+  @Override
   public int advance(int target) throws IOException {
     return reqScorer.advance(target);
   }
   
+  @Override
   public int docID() {
     return reqScorer.docID();
   }
@@ -60,6 +63,7 @@
    * @return The score of the required scorer, eventually increased by the score
    * of the optional scorer when it also matches the current document.
    */
+  @Override
   public float score() throws IOException {
     int curDoc = reqScorer.docID();
     float reqScore = reqScorer.score();
@@ -76,16 +80,5 @@
     return optScorerDoc == curDoc ? reqScore + optScorer.score() : reqScore;
   }
 
-  /** Explain the score of a document.
-   * TODO: Also show the total score.
-   * See BooleanScorer.explain() on how to do this.
-   */
-  public Explanation explain(int doc) throws IOException {
-    Explanation res = new Explanation();
-    res.setDescription("required, optional");
-    res.addDetail(reqScorer.explain(doc));
-    res.addDetail(optScorer.explain(doc));
-    return res;
-  }
 }
 

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ScoreCachingWrappingScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ScoreCachingWrappingScorer.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ScoreCachingWrappingScorer.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ScoreCachingWrappingScorer.java Thu Oct 29 21:29:47 2009
@@ -42,18 +42,17 @@
     this.scorer = scorer;
   }
 
+  @Override
   protected boolean score(Collector collector, int max, int firstDocID) throws IOException {
     return scorer.score(collector, max, firstDocID);
   }
 
+  @Override
   public Similarity getSimilarity() {
     return scorer.getSimilarity();
   }
   
-  public Explanation explain(int doc) throws IOException {
-    return scorer.explain(doc);
-  }
-
+  @Override
   public float score() throws IOException {
     int doc = scorer.docID();
     if (doc != curDoc) {
@@ -64,18 +63,22 @@
     return curScore;
   }
 
+  @Override
   public int docID() {
     return scorer.docID();
   }
 
+  @Override
   public int nextDoc() throws IOException {
     return scorer.nextDoc();
   }
   
+  @Override
   public void score(Collector collector) throws IOException {
     scorer.score(collector);
   }
   
+  @Override
   public int advance(int target) throws IOException {
     return scorer.advance(target);
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ScoreDoc.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ScoreDoc.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ScoreDoc.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ScoreDoc.java Thu Oct 29 21:29:47 2009
@@ -35,6 +35,7 @@
   }
   
   // A convenience method for debugging.
+  @Override
   public String toString() {
     return "doc=" + doc + " score=" + score;
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Scorer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Scorer.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Scorer.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Scorer.java Thu Oct 29 21:29:47 2009
@@ -56,7 +56,6 @@
 
   /** Scores and collects all matching documents.
    * @param collector The collector to which all matching documents are passed.
-   * <br>When this method is used the {@link #explain(int)} method should not be used.
    */
   public void score(Collector collector) throws IOException {
     collector.setScorer(this);
@@ -97,16 +96,4 @@
    */
   public abstract float score() throws IOException;
 
-  /** Returns an explanation of the score for a document.
-   * <br>When this method is used, the {@link #next()}, {@link #skipTo(int)} and
-   * {@link #score(HitCollector)} methods should not be used.
-   * @param doc The document number for the explanation.
-   *
-   * @deprecated Please use {@link IndexSearcher#explain}
-   * or {@link Weight#explain} instead.
-   */
-  public Explanation explain(int doc) throws IOException {
-    throw new UnsupportedOperationException();
-  }
-
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Searchable.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Searchable.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Searchable.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Searchable.java Thu Oct 29 21:29:47 2009
@@ -155,7 +155,7 @@
    * <code>sort</code>.
    *
    * <p>Applications should usually call {@link
-   * Searcher#search(Query,Filter,Sort)} instead.
+   * Searcher#search(Query,Filter,int,Sort)} instead.
    * 
    * @throws BooleanQuery.TooManyClauses
    */

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Searcher.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Searcher.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Searcher.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Searcher.java Thu Oct 29 21:29:47 2009
@@ -37,11 +37,9 @@
    * <code>filter</code> if non-null, and sorting the hits by the criteria in
    * <code>sort</code>.
    * 
-   * <b>NOTE:</b> currently, this method tracks document scores and sets them in
-   * the returned {@link FieldDoc}, however in 3.0 it will move to not track
-   * document scores. If document scores tracking is still needed, you can use
-   * {@link #search(Weight, Filter, Collector)} and pass in a
-   * {@link TopFieldCollector} instance.
+   * <p>NOTE: this does not compute scores by default; use
+   * {@link IndexSearcher#setDefaultFieldSortScoring} to
+   * enable scoring.
    *
    * @throws BooleanQuery.TooManyClauses
    */

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Similarity.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Similarity.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Similarity.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Similarity.java Thu Oct 29 21:29:47 2009
@@ -26,7 +26,6 @@
 import java.io.IOException;
 import java.io.Serializable;
 import java.util.Collection;
-import java.util.IdentityHashMap;
 
 
 /** 
@@ -526,7 +525,11 @@
  * @see Searcher#setSimilarity(Similarity)
  */
 public abstract class Similarity implements Serializable {
-
+  
+  /**
+   * The Similarity implementation used by default.
+   **/
+  private static Similarity defaultImpl = new DefaultSimilarity();
   public static final int NO_DOC_ID_PROVIDED = -1;
 
   /** Set the default Similarity implementation used by indexing and search
@@ -832,10 +835,5 @@
   {
     return 1;
   }
-  
-  /** The Similarity implementation used by default. 
-   *  TODO: move back to top when old API is removed! 
-   **/
-  private static Similarity defaultImpl = new DefaultSimilarity();
 
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/SimilarityDelegator.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/SimilarityDelegator.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/SimilarityDelegator.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/SimilarityDelegator.java Thu Oct 29 21:29:47 2009
@@ -34,34 +34,42 @@
     this.delegee = delegee;
   }
 
+  @Override
   public float computeNorm(String fieldName, FieldInvertState state) {
     return delegee.computeNorm(fieldName, state);
   }
   
+  @Override
   public float lengthNorm(String fieldName, int numTerms) {
     return delegee.lengthNorm(fieldName, numTerms);
   }
   
+  @Override
   public float queryNorm(float sumOfSquaredWeights) {
     return delegee.queryNorm(sumOfSquaredWeights);
   }
 
+  @Override
   public float tf(float freq) {
     return delegee.tf(freq);
   }
     
+  @Override
   public float sloppyFreq(int distance) {
     return delegee.sloppyFreq(distance);
   }
     
+  @Override
   public float idf(int docFreq, int numDocs) {
     return delegee.idf(docFreq, numDocs);
   }
     
+  @Override
   public float coord(int overlap, int maxOverlap) {
     return delegee.coord(overlap, maxOverlap);
   }
 
+  @Override
   public float scorePayload(int docId, String fieldName, int start, int end, byte [] payload, int offset, int length) {
     return delegee.scorePayload(docId, fieldName, start, end, payload, offset, length);
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/SloppyPhraseScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/SloppyPhraseScorer.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/SloppyPhraseScorer.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/SloppyPhraseScorer.java Thu Oct 29 21:29:47 2009
@@ -52,6 +52,7 @@
      * would get same score as "g f"~2, although "c b"~2 could be matched twice.
      * We may want to fix this in the future (currently not, for performance reasons).
      */
+    @Override
     protected final float phraseFreq() throws IOException {
         int end = initPhrasePositions();
         

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Sort.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Sort.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Sort.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Sort.java Thu Oct 29 21:29:47 2009
@@ -151,6 +151,7 @@
     return fields;
   }
 
+  @Override
   public String toString() {
     StringBuilder buffer = new StringBuilder();
 
@@ -164,6 +165,7 @@
   }
 
   /** Returns true if <code>o</code> is equal to this. */
+  @Override
   public boolean equals(Object o) {
     if (this == o) return true;
     if (!(o instanceof Sort)) return false;
@@ -172,10 +174,8 @@
   }
 
   /** Returns a hash code value for this object. */
+  @Override
   public int hashCode() {
-    // TODO in Java 1.5: switch to Arrays.hashCode().  The 
-    // Java 1.4 workaround below calculates the same hashCode
-    // as Java 1.5's new Arrays.hashCode()
-    return 0x45aaf665 + Arrays.asList(fields).hashCode();
+    return 0x45aaf665 + Arrays.hashCode(fields);
   }
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/SortField.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/SortField.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/SortField.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/SortField.java Thu Oct 29 21:29:47 2009
@@ -260,6 +260,7 @@
     return reverse;
   }
 
+  @Override
   public String toString() {
     StringBuilder buffer = new StringBuilder();
     switch (type) {
@@ -323,6 +324,7 @@
    *  {@link FieldComparatorSource} or {@link
    *  FieldCache.Parser} was provided, it must properly
    *  implement equals (unless a singleton is always used). */
+  @Override
   public boolean equals(Object o) {
     if (this == o) return true;
     if (!(o instanceof SortField)) return false;
@@ -342,6 +344,7 @@
    *  FieldCache.Parser} was provided, it must properly
    *  implement hashCode (unless a singleton is always
    *  used). */
+  @Override
   public int hashCode() {
     int hash=type^0x346565dd + Boolean.valueOf(reverse).hashCode()^0xaf5998bb;
     if (field != null) hash += field.hashCode()^0xff5685dd;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/SpanQueryFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/SpanQueryFilter.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/SpanQueryFilter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/SpanQueryFilter.java Thu Oct 29 21:29:47 2009
@@ -54,11 +54,13 @@
     this.query = query;
   }
 
+  @Override
   public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
     SpanFilterResult result = bitSpans(reader);
     return result.getDocIdSet();
   }
 
+  @Override
   public SpanFilterResult bitSpans(IndexReader reader) throws IOException {
 
     final OpenBitSet bits = new OpenBitSet(reader.maxDoc());
@@ -86,14 +88,17 @@
     return query;
   }
 
+  @Override
   public String toString() {
     return "SpanQueryFilter(" + query + ")";
   }
 
+  @Override
   public boolean equals(Object o) {
     return o instanceof SpanQueryFilter && this.query.equals(((SpanQueryFilter) o).query);
   }
 
+  @Override
   public int hashCode() {
     return query.hashCode() ^ 0x923F64B9;
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermQuery.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermQuery.java Thu Oct 29 21:29:47 2009
@@ -48,22 +48,29 @@
       idf = idfExp.getIdf();
     }
 
+    @Override
     public String toString() { return "weight(" + TermQuery.this + ")"; }
 
+    @Override
     public Query getQuery() { return TermQuery.this; }
+
+    @Override
     public float getValue() { return value; }
 
+    @Override
     public float sumOfSquaredWeights() {
       queryWeight = idf * getBoost();             // compute query weight
       return queryWeight * queryWeight;           // square it
     }
 
+    @Override
     public void normalize(float queryNorm) {
       this.queryNorm = queryNorm;
       queryWeight *= queryNorm;                   // normalize query weight
       value = queryWeight * idf;                  // idf for document
     }
 
+    @Override
     public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException {
       DocsEnum docs = reader.termDocsEnum(reader.getDeletedDocs(), term.field(), new TermRef(term.text()));
       if (docs == null) {
@@ -73,6 +80,7 @@
       return new TermScorer(this, docs, similarity, reader.norms(term.field()));
     }
 
+    @Override
     public Explanation explain(IndexReader reader, int doc)
       throws IOException {
 
@@ -105,8 +113,21 @@
       fieldExpl.setDescription("fieldWeight("+term+" in "+doc+
                                "), product of:");
 
-      Explanation tfExpl = scorer(reader, true, false).explain(doc);
-      fieldExpl.addDetail(tfExpl);
+      Explanation tfExplanation = new Explanation();
+      int tf = 0;
+      DocsEnum docs = reader.termDocsEnum(reader.getDeletedDocs(), term.field(), new TermRef(term.text()));
+      if (docs != null) {
+          int newDoc = docs.advance(doc);
+          if (newDoc == doc) {
+            tf = docs.freq();
+          }
+        tfExplanation.setValue(similarity.tf(tf));
+        tfExplanation.setDescription("tf(termFreq("+term+")="+tf+")");
+      } else {
+        tfExplanation.setValue(0.0f);
+        tfExplanation.setDescription("no matching term");
+      }
+      fieldExpl.addDetail(tfExplanation);
       fieldExpl.addDetail(expl);
 
       Explanation fieldNormExpl = new Explanation();
@@ -117,8 +138,8 @@
       fieldNormExpl.setDescription("fieldNorm(field="+field+", doc="+doc+")");
       fieldExpl.addDetail(fieldNormExpl);
       
-      fieldExpl.setMatch(Boolean.valueOf(tfExpl.isMatch()));
-      fieldExpl.setValue(tfExpl.getValue() *
+      fieldExpl.setMatch(Boolean.valueOf(tfExplanation.isMatch()));
+      fieldExpl.setValue(tfExplanation.getValue() *
                          expl.getValue() *
                          fieldNormExpl.getValue());
 
@@ -143,15 +164,18 @@
   /** Returns the term of this query. */
   public Term getTerm() { return term; }
 
+  @Override
   public Weight createWeight(Searcher searcher) throws IOException {
     return new TermWeight(searcher);
   }
 
+  @Override
   public void extractTerms(Set<Term> terms) {
     terms.add(getTerm());
   }
 
   /** Prints a user-readable version of this query. */
+  @Override
   public String toString(String field) {
     StringBuilder buffer = new StringBuilder();
     if (!term.field().equals(field)) {
@@ -164,6 +188,7 @@
   }
 
   /** Returns true iff <code>o</code> is equal to this. */
+  @Override
   public boolean equals(Object o) {
     if (!(o instanceof TermQuery))
       return false;
@@ -173,6 +198,7 @@
   }
 
   /** Returns a hash code value for this object.*/
+  @Override
   public int hashCode() {
     return Float.floatToIntBits(getBoost()) ^ term.hashCode();
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermRangeTermEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermRangeTermEnum.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermRangeTermEnum.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermRangeTermEnum.java Thu Oct 29 21:29:47 2009
@@ -94,14 +94,17 @@
     setEnum(reader.terms(new Term(this.field, startTermText)));
   }
 
+  @Override
   public float difference() {
     return 1.0f;
   }
 
+  @Override
   protected boolean endEnum() {
     return endEnum;
   }
 
+  @Override
   protected boolean termCompare(Term term) {
     if (collator == null) {
       // Use Unicode code point ordering

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermScorer.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermScorer.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermScorer.java Thu Oct 29 21:29:47 2009
@@ -27,7 +27,6 @@
   
   private static final float[] SIM_NORM_DECODER = Similarity.getNormDecoder();
   
-  private Weight weight;
   private DocsEnum docsEnum;
   private byte[] norms;
   private float weightValue;
@@ -56,7 +55,6 @@
    */
   TermScorer(Weight weight, DocsEnum td, Similarity similarity, byte[] norms) {
     super(similarity);
-    this.weight = weight;
     this.docsEnum = td;
     this.norms = norms;
     this.weightValue = weight.getValue();
@@ -65,11 +63,13 @@
       scoreCache[i] = getSimilarity().tf(i) * weightValue;
   }
 
+  @Override
   public void score(Collector c) throws IOException {
     score(c, Integer.MAX_VALUE, nextDoc());
   }
 
   // firstDocID is ignored since nextDoc() sets 'doc'
+  @Override
   protected boolean score(Collector c, int end, int firstDocID) throws IOException {
     //System.out.println("top score " + firstDocID + " max=" + pointerMax);
     c.setScorer(this);
@@ -90,6 +90,7 @@
     return true;
   }
 
+  @Override
   public int docID() { return doc; }
 
   /**
@@ -99,6 +100,7 @@
    * 
    * @return the document matching the query or NO_MORE_DOCS if there are no more documents.
    */
+  @Override
   public int nextDoc() throws IOException {
     //System.out.println("ts.nextDoc pointer=" + pointer + " max=" + pointerMax + " this=" + this + " docsEnum=" + docsEnum);
     pointer++;
@@ -117,6 +119,7 @@
     return doc;
   }
   
+  @Override
   public float score() {
     assert doc != NO_MORE_DOCS;
     int f = freqs[pointer];
@@ -137,6 +140,7 @@
    *          The target document number.
    * @return the matching document or NO_MORE_DOCS if none exist.
    */
+  @Override
   public int advance(int target) throws IOException {
     // first scan in cache
     for (pointer++; pointer < pointerMax; pointer++) {
@@ -158,32 +162,9 @@
     }
     return doc;
   }
-  
-  /** Returns an explanation of the score for a document.
-   * @param doc The document number for the explanation.
-   */
-  public Explanation explain(int doc) throws IOException {
-    TermQuery query = (TermQuery) weight.getQuery();
-    Explanation tfExplanation = new Explanation();
-    int tf = 0;
-    while (pointer < pointerMax) {
-      if (docs[pointer] == doc)
-        tf = freqs[pointer];
-      pointer++;
-    }
-    if (tf == 0) {
-      int newDoc = docsEnum.advance(doc);
-      if (newDoc == doc) {
-        tf = docsEnum.freq();
-      }
-    }
-    tfExplanation.setValue(getSimilarity().tf(tf));
-    tfExplanation.setDescription("tf(termFreq("+query.getTerm()+")="+tf+")");
-    
-    return tfExplanation;
-  }
 
   /** Returns a string representation of this <code>TermScorer</code>. */
   // nocommit
+  //@Override
   //public String toString() { return "scorer(" + weight + ")"; }
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TimeLimitingCollector.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TimeLimitingCollector.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TimeLimitingCollector.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TimeLimitingCollector.java Thu Oct 29 21:29:47 2009
@@ -70,6 +70,7 @@
       this.setDaemon( true );
     }
 
+    @Override
     public void run() {
       while (true) {
         // TODO: Use System.nanoTime() when Lucene moves to Java SE 5.
@@ -194,6 +195,7 @@
    * @throws TimeExceededException
    *           if the time allowed has exceeded.
    */
+  @Override
   public void collect(final int doc) throws IOException {
     long time = TIMER_THREAD.getMilliseconds();
     if (timeout < time) {
@@ -208,14 +210,17 @@
     collector.collect(doc);
   }
   
+  @Override
   public void setNextReader(IndexReader reader, int base) throws IOException {
     collector.setNextReader(reader, base);
   }
   
+  @Override
   public void setScorer(Scorer scorer) throws IOException {
     collector.setScorer(scorer);
   }
 
+  @Override
   public boolean acceptsDocsOutOfOrder() {
     return collector.acceptsDocsOutOfOrder();
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TopFieldCollector.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TopFieldCollector.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TopFieldCollector.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TopFieldCollector.java Thu Oct 29 21:29:47 2009
@@ -63,6 +63,7 @@
       bottom = pq.updateTop();
     }
 
+    @Override
     public void collect(int doc) throws IOException {
       ++totalHits;
       if (queueFull) {
@@ -89,11 +90,13 @@
       }
     }
     
+    @Override
     public void setNextReader(IndexReader reader, int docBase) throws IOException {
       this.docBase = docBase;
       comparator.setNextReader(reader, docBase);
     }
     
+    @Override
     public void setScorer(Scorer scorer) throws IOException {
       comparator.setScorer(scorer);
     }
@@ -113,6 +116,7 @@
       super(queue, numHits, fillFields);
     }
     
+    @Override
     public void collect(int doc) throws IOException {
       ++totalHits;
       if (queueFull) {
@@ -138,6 +142,7 @@
       }
     }
     
+    @Override
     public boolean acceptsDocsOutOfOrder() {
       return true;
     }
@@ -164,6 +169,7 @@
       bottom = pq.updateTop();
     }
 
+    @Override
     public void collect(int doc) throws IOException {
       ++totalHits;
       if (queueFull) {
@@ -196,6 +202,7 @@
       }
     }
     
+    @Override
     public void setScorer(Scorer scorer) throws IOException {
       this.scorer = scorer;
       comparator.setScorer(scorer);
@@ -217,6 +224,7 @@
       super(queue, numHits, fillFields);
     }
     
+    @Override
     public void collect(int doc) throws IOException {
       ++totalHits;
       if (queueFull) {
@@ -248,6 +256,7 @@
       }
     }
     
+    @Override
     public boolean acceptsDocsOutOfOrder() {
       return true;
     }
@@ -276,6 +285,7 @@
       bottom =  pq.updateTop();
     }
 
+    @Override
     public void collect(int doc) throws IOException {
       final float score = scorer.score();
       if (score > maxScore) {
@@ -307,6 +317,7 @@
 
     }
     
+    @Override
     public void setScorer(Scorer scorer) throws IOException {
       this.scorer = scorer;
       super.setScorer(scorer);
@@ -326,6 +337,7 @@
       super(queue, numHits, fillFields);
     }
     
+    @Override
     public void collect(int doc) throws IOException {
       final float score = scorer.score();
       if (score > maxScore) {
@@ -355,6 +367,7 @@
       }
     }
     
+    @Override
     public boolean acceptsDocsOutOfOrder() {
       return true;
     }
@@ -383,6 +396,7 @@
       bottom = pq.updateTop();
     }
 
+    @Override
     public void collect(int doc) throws IOException {
       ++totalHits;
       if (queueFull) {
@@ -429,6 +443,7 @@
       }
     }
 
+    @Override
     public void setNextReader(IndexReader reader, int docBase) throws IOException {
       this.docBase = docBase;
       for (int i = 0; i < comparators.length; i++) {
@@ -436,6 +451,7 @@
       }
     }
 
+    @Override
     public void setScorer(Scorer scorer) throws IOException {
       // set the scorer on all comparators
       for (int i = 0; i < comparators.length; i++) {
@@ -457,6 +473,7 @@
       super(queue, numHits, fillFields);
     }
     
+    @Override
     public void collect(int doc) throws IOException {
       ++totalHits;
       if (queueFull) {
@@ -505,6 +522,7 @@
       }
     }
     
+    @Override
     public boolean acceptsDocsOutOfOrder() {
       return true;
     }
@@ -532,6 +550,7 @@
       bottom =  pq.updateTop();
     }
 
+    @Override
     public void collect(int doc) throws IOException {
       final float score = scorer.score();
       if (score > maxScore) {
@@ -582,6 +601,7 @@
       }
     }
 
+    @Override
     public void setScorer(Scorer scorer) throws IOException {
       this.scorer = scorer;
       super.setScorer(scorer);
@@ -601,6 +621,7 @@
       super(queue, numHits, fillFields);
     }
     
+    @Override
     public void collect(int doc) throws IOException {
       final float score = scorer.score();
       if (score > maxScore) {
@@ -653,6 +674,7 @@
       }
     }
     
+    @Override
     public boolean acceptsDocsOutOfOrder() {
       return true;
     }
@@ -678,6 +700,7 @@
       bottom = pq.updateTop();
     }
 
+    @Override
     public void collect(int doc) throws IOException {
       ++totalHits;
       if (queueFull) {
@@ -729,6 +752,7 @@
       }
     }
 
+    @Override
     public void setScorer(Scorer scorer) throws IOException {
       this.scorer = scorer;
       super.setScorer(scorer);
@@ -749,6 +773,7 @@
       super(queue, numHits, fillFields);
     }
     
+    @Override
     public void collect(int doc) throws IOException {
       ++totalHits;
       if (queueFull) {
@@ -802,11 +827,13 @@
       }
     }
 
+    @Override
     public void setScorer(Scorer scorer) throws IOException {
       this.scorer = scorer;
       super.setScorer(scorer);
     }
     
+    @Override
     public boolean acceptsDocsOutOfOrder() {
       return true;
     }
@@ -934,6 +961,7 @@
    * topDocs(int, int) calls them to return the results.
    */
 
+  @Override
   protected void populateResults(ScoreDoc[] results, int howMany) {
     if (fillFields) {
       // avoid casting if unnecessary.
@@ -949,6 +977,7 @@
     }
   }
   
+  @Override
   protected TopDocs newTopDocs(ScoreDoc[] results, int start) {
     if (results == null) {
       results = EMPTY_SCOREDOCS;
@@ -960,6 +989,7 @@
     return new TopFieldDocs(totalHits, results, ((FieldValueHitQueue) pq).getFields(), maxScore);
   }
   
+  @Override
   public boolean acceptsDocsOutOfOrder() {
     return false;
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TopScoreDocCollector.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TopScoreDocCollector.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TopScoreDocCollector.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TopScoreDocCollector.java Thu Oct 29 21:29:47 2009
@@ -42,6 +42,7 @@
       super(numHits);
     }
     
+    @Override
     public void collect(int doc) throws IOException {
       float score = scorer.score();
       totalHits++;
@@ -56,6 +57,7 @@
       pqTop = pq.updateTop();
     }
     
+    @Override
     public boolean acceptsDocsOutOfOrder() {
       return false;
     }
@@ -67,6 +69,7 @@
       super(numHits);
     }
     
+    @Override
     public void collect(int doc) throws IOException {
       float score = scorer.score();
       totalHits++;
@@ -79,6 +82,7 @@
       pqTop = pq.updateTop();
     }
     
+    @Override
     public boolean acceptsDocsOutOfOrder() {
       return true;
     }
@@ -116,6 +120,7 @@
     pqTop = pq.top();
   }
 
+  @Override
   protected TopDocs newTopDocs(ScoreDoc[] results, int start) {
     if (results == null) {
       return EMPTY_TOPDOCS;
@@ -136,10 +141,12 @@
     return new TopDocs(totalHits, results, maxScore);
   }
   
+  @Override
   public void setNextReader(IndexReader reader, int base) {
     docBase = base;
   }
   
+  @Override
   public void setScorer(Scorer scorer) throws IOException {
     this.scorer = scorer;
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/WildcardQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/WildcardQuery.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/WildcardQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/WildcardQuery.java Thu Oct 29 21:29:47 2009
@@ -56,6 +56,7 @@
   }
   
   // @deprecated see getTermsEnum
+  @Override
   protected FilteredTermEnum getEnum(IndexReader reader) throws IOException {
     if (termContainsWildcard)
       return new WildcardTermEnum(reader, getTerm());

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/WildcardTermEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/WildcardTermEnum.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/WildcardTermEnum.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/WildcardTermEnum.java Thu Oct 29 21:29:47 2009
@@ -66,6 +66,7 @@
     setEnum(reader.terms(new Term(searchTerm.field(), pre)));
   }
 
+  @Override
   protected final boolean termCompare(Term term) {
     if (field == term.field()) {
       String searchText = term.text();
@@ -77,10 +78,12 @@
     return false;
   }
 
+  @Override
   public float difference() {
     return 1.0f;
   }
 
+  @Override
   public final boolean endEnum() {
     return endEnum;
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ByteFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ByteFieldSource.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ByteFieldSource.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ByteFieldSource.java Thu Oct 29 21:29:47 2009
@@ -66,27 +66,33 @@
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.ValueSource#description() */
+  @Override
   public String description() {
     return "byte(" + super.description() + ')';
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.FieldCacheSource#getCachedValues(org.apache.lucene.search.FieldCache, java.lang.String, org.apache.lucene.index.IndexReader) */
+  @Override
   public DocValues getCachedFieldValues (FieldCache cache, String field, IndexReader reader) throws IOException {
     final byte[] arr = cache.getBytes(reader, field, parser);
     return new DocValues() {
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#floatVal(int) */
+      @Override
       public float floatVal(int doc) { 
         return (float) arr[doc]; 
       }
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#intVal(int) */
+      @Override
       public  int intVal(int doc) { 
         return arr[doc]; 
       }
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#toString(int) */
+      @Override
       public String toString(int doc) { 
         return  description() + '=' + intVal(doc);  
       }
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#getInnerArray() */
+      @Override
       Object getInnerArray() {
         return arr;
       }
@@ -94,6 +100,7 @@
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.FieldCacheSource#cachedFieldSourceEquals(org.apache.lucene.search.function.FieldCacheSource) */
+  @Override
   public boolean cachedFieldSourceEquals(FieldCacheSource o) {
     if (o.getClass() !=  ByteFieldSource.class) {
       return false;
@@ -105,6 +112,7 @@
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.FieldCacheSource#cachedFieldSourceHashCode() */
+  @Override
   public int cachedFieldSourceHashCode() {
     return parser==null ? 
       Byte.class.hashCode() : parser.getClass().hashCode();

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/CustomScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/CustomScoreQuery.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/CustomScoreQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/CustomScoreQuery.java Thu Oct 29 21:29:47 2009
@@ -19,6 +19,7 @@
 
 import java.io.IOException;
 import java.util.Set;
+import java.util.Arrays;
 
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.Term;
@@ -90,6 +91,7 @@
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.Query#rewrite(org.apache.lucene.index.IndexReader) */
+  @Override
   public Query rewrite(IndexReader reader) throws IOException {
     subQuery = subQuery.rewrite(reader);
     for(int i = 0; i < valSrcQueries.length; i++) {
@@ -99,6 +101,7 @@
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.Query#extractTerms(java.util.Set) */
+  @Override
   public void extractTerms(Set<Term> terms) {
     subQuery.extractTerms(terms);
     for(int i = 0; i < valSrcQueries.length; i++) {
@@ -107,6 +110,7 @@
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.Query#clone() */
+  @Override
   public Object clone() {
     CustomScoreQuery clone = (CustomScoreQuery)super.clone();
     clone.subQuery = (Query) subQuery.clone();
@@ -118,6 +122,7 @@
   }
 
   /* (non-Javadoc) @see org.apache.lucene.search.Query#toString(java.lang.String) */
+  @Override
   public String toString(String field) {
     StringBuilder sb = new StringBuilder(name()).append("(");
     sb.append(subQuery.toString(field));
@@ -130,6 +135,7 @@
   }
 
   /** Returns true if <code>o</code> is equal to this. */
+  @Override
   public boolean equals(Object o) {
     if (getClass() != o.getClass()) {
       return false;
@@ -140,21 +146,14 @@
         this.valSrcQueries.length != other.valSrcQueries.length) {
       return false;
     }
-    for (int i=0; i<valSrcQueries.length; i++) { //TODO simplify with Arrays.deepEquals() once moving to Java 1.5
-      if (!valSrcQueries[i].equals(other.valSrcQueries[i])) {
-        return false;
-      }
-    }
-    return true;
+    return Arrays.equals(valSrcQueries, other.valSrcQueries);
   }
 
   /** Returns a hash code value for this object. */
+  @Override
   public int hashCode() {
-    int valSrcHash = 0;
-    for (int i=0; i<valSrcQueries.length; i++) { //TODO simplify with Arrays.deepHashcode() once moving to Java 1.5
-      valSrcHash += valSrcQueries[i].hashCode();
-    }
-    return (getClass().hashCode() + subQuery.hashCode() + valSrcHash) ^ Float.floatToIntBits(getBoost());
+    return (getClass().hashCode() + subQuery.hashCode() + Arrays.hashCode(valSrcQueries))
+      ^ Float.floatToIntBits(getBoost());
   }  
   
   /**
@@ -289,16 +288,19 @@
     }
 
     /*(non-Javadoc) @see org.apache.lucene.search.Weight#getQuery() */
+    @Override
     public Query getQuery() {
       return CustomScoreQuery.this;
     }
 
     /*(non-Javadoc) @see org.apache.lucene.search.Weight#getValue() */
+    @Override
     public float getValue() {
       return getBoost();
     }
 
     /*(non-Javadoc) @see org.apache.lucene.search.Weight#sumOfSquaredWeights() */
+    @Override
     public float sumOfSquaredWeights() throws IOException {
       float sum = subQueryWeight.sumOfSquaredWeights();
       for(int i = 0; i < valSrcWeights.length; i++) {
@@ -313,6 +315,7 @@
     }
 
     /*(non-Javadoc) @see org.apache.lucene.search.Weight#normalize(float) */
+    @Override
     public void normalize(float norm) {
       norm *= getBoost(); // incorporate boost
       subQueryWeight.normalize(norm);
@@ -325,6 +328,7 @@
       }
     }
 
+    @Override
     public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException {
       // Pass true for "scoresDocsInOrder", because we
       // require in-order scoring, even if caller does not,
@@ -342,24 +346,21 @@
       return new CustomScorer(similarity, reader, this, subQueryScorer, valSrcScorers);
     }
 
+    @Override
     public Explanation explain(IndexReader reader, int doc) throws IOException {
       Explanation explain = doExplain(reader, doc);
       return explain == null ? new Explanation(0.0f, "no matching docs") : doExplain(reader, doc);
     }
     
     private Explanation doExplain(IndexReader reader, int doc) throws IOException {
-      Scorer[] valSrcScorers = new Scorer[valSrcWeights.length];
-      for(int i = 0; i < valSrcScorers.length; i++) {
-         valSrcScorers[i] = valSrcWeights[i].scorer(reader, true, false);
-      }
       Explanation subQueryExpl = subQueryWeight.explain(reader, doc);
       if (!subQueryExpl.isMatch()) {
         return subQueryExpl;
       }
       // match
-      Explanation[] valSrcExpls = new Explanation[valSrcScorers.length];
-      for(int i = 0; i < valSrcScorers.length; i++) {
-        valSrcExpls[i] = valSrcScorers[i].explain(doc);
+      Explanation[] valSrcExpls = new Explanation[valSrcWeights.length];
+      for(int i = 0; i < valSrcWeights.length; i++) {
+        valSrcExpls[i] = valSrcWeights[i].explain(reader, doc);
       }
       Explanation customExp = customExplain(doc,subQueryExpl,valSrcExpls);
       float sc = getValue() * customExp.getValue();
@@ -370,6 +371,7 @@
       return res;
     }
 
+    @Override
     public boolean scoresDocsOutOfOrder() {
       return false;
     }
@@ -402,6 +404,7 @@
       this.vScores = new float[valSrcScorers.length];
     }
 
+    @Override
     public int nextDoc() throws IOException {
       int doc = subQueryScorer.nextDoc();
       if (doc != NO_MORE_DOCS) {
@@ -412,11 +415,13 @@
       return doc;
     }
 
+    @Override
     public int docID() {
       return subQueryScorer.docID();
     }
     
     /*(non-Javadoc) @see org.apache.lucene.search.Scorer#score() */
+    @Override
     public float score() throws IOException {
       for (int i = 0; i < valSrcScorers.length; i++) {
         vScores[i] = valSrcScorers[i].score();
@@ -424,6 +429,7 @@
       return qWeight * customScore(subQueryScorer.docID(), subQueryScorer.score(), vScores);
     }
 
+    @Override
     public int advance(int target) throws IOException {
       int doc = subQueryScorer.advance(target);
       if (doc != NO_MORE_DOCS) {
@@ -433,29 +439,9 @@
       }
       return doc;
     }
-    
-    // TODO: remove in 3.0
-    /*(non-Javadoc) @see org.apache.lucene.search.Scorer#explain(int) */
-    public Explanation explain(int doc) throws IOException {
-      Explanation subQueryExpl = weight.subQueryWeight.explain(reader,doc);
-      if (!subQueryExpl.isMatch()) {
-        return subQueryExpl;
-      }
-      // match
-      Explanation[] valSrcExpls = new Explanation[valSrcScorers.length];
-      for(int i = 0; i < valSrcScorers.length; i++) {
-        valSrcExpls[i] = valSrcScorers[i].explain(doc);
-      }
-      Explanation customExp = customExplain(doc,subQueryExpl,valSrcExpls);
-      float sc = qWeight * customExp.getValue();
-      Explanation res = new ComplexExplanation(
-        true, sc, CustomScoreQuery.this.toString() + ", product of:");
-      res.addDetail(customExp);
-      res.addDetail(new Explanation(qWeight, "queryBoost")); // actually using the q boost as q weight (== weight value)
-      return res;
-    }
   }
 
+  @Override
   public Weight createWeight(Searcher searcher) throws IOException {
     return new CustomWeight(searcher);
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/FieldCacheSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/FieldCacheSource.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/FieldCacheSource.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/FieldCacheSource.java Thu Oct 29 21:29:47 2009
@@ -60,11 +60,13 @@
   }
 
   /* (non-Javadoc) @see org.apache.lucene.search.function.ValueSource#getValues(org.apache.lucene.index.IndexReader) */
+  @Override
   public final DocValues getValues(IndexReader reader) throws IOException {
     return getCachedFieldValues(FieldCache.DEFAULT, field, reader);
   }
 
   /* (non-Javadoc) @see org.apache.lucene.search.function.ValueSource#description() */
+  @Override
   public String description() {
     return field;
   }
@@ -78,6 +80,7 @@
   public abstract DocValues getCachedFieldValues(FieldCache cache, String field, IndexReader reader) throws IOException;
 
   /*(non-Javadoc) @see java.lang.Object#equals(java.lang.Object) */
+  @Override
   public final boolean equals(Object o) {
     if (!(o instanceof FieldCacheSource)) {
       return false;
@@ -89,6 +92,7 @@
   }
 
   /*(non-Javadoc) @see java.lang.Object#hashCode() */
+  @Override
   public final int hashCode() {
     return 
       field.hashCode() +

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/FieldScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/FieldScoreQuery.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/FieldScoreQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/FieldScoreQuery.java Thu Oct 29 21:29:47 2009
@@ -90,6 +90,7 @@
       this.typeName = name;
     }
     /*(non-Javadoc) @see java.lang.Object#toString() */
+    @Override
     public String toString() {
       return getClass().getName()+"::"+typeName;
     }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/FloatFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/FloatFieldSource.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/FloatFieldSource.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/FloatFieldSource.java Thu Oct 29 21:29:47 2009
@@ -66,23 +66,28 @@
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.ValueSource#description() */
+  @Override
   public String description() {
     return "float(" + super.description() + ')';
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.FieldCacheSource#getCachedValues(org.apache.lucene.search.FieldCache, java.lang.String, org.apache.lucene.index.IndexReader) */
+  @Override
   public DocValues getCachedFieldValues (FieldCache cache, String field, IndexReader reader) throws IOException {
     final float[] arr = cache.getFloats(reader, field, parser);
     return new DocValues() {
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#floatVal(int) */
+      @Override
       public float floatVal(int doc) {
         return arr[doc];      
       }
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#toString(int) */
+      @Override
       public String toString(int doc) { 
         return  description() + '=' + arr[doc];  
       }
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#getInnerArray() */
+      @Override
       Object getInnerArray() {
         return arr;
       }
@@ -90,6 +95,7 @@
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.FieldCacheSource#cachedFieldSourceEquals(org.apache.lucene.search.function.FieldCacheSource) */
+  @Override
   public boolean cachedFieldSourceEquals(FieldCacheSource o) {
     if (o.getClass() !=  FloatFieldSource.class) {
       return false;
@@ -101,6 +107,7 @@
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.FieldCacheSource#cachedFieldSourceHashCode() */
+  @Override
   public int cachedFieldSourceHashCode() {
     return parser==null ? 
       Float.class.hashCode() : parser.getClass().hashCode();

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/IntFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/IntFieldSource.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/IntFieldSource.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/IntFieldSource.java Thu Oct 29 21:29:47 2009
@@ -66,27 +66,33 @@
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.ValueSource#description() */
+  @Override
   public String description() {
     return "int(" + super.description() + ')';
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.FieldCacheSource#getCachedValues(org.apache.lucene.search.FieldCache, java.lang.String, org.apache.lucene.index.IndexReader) */
+  @Override
   public DocValues getCachedFieldValues (FieldCache cache, String field, IndexReader reader) throws IOException {
     final int[] arr = cache.getInts(reader, field, parser);
     return new DocValues() {
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#floatVal(int) */
+      @Override
       public float floatVal(int doc) { 
         return (float) arr[doc]; 
       }
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#intVal(int) */
+      @Override
       public  int intVal(int doc) { 
         return arr[doc]; 
       }
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#toString(int) */
+      @Override
       public String toString(int doc) { 
         return  description() + '=' + intVal(doc);  
       }
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#getInnerArray() */
+      @Override
       Object getInnerArray() {
         return arr;
       }
@@ -94,6 +100,7 @@
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.FieldCacheSource#cachedFieldSourceEquals(org.apache.lucene.search.function.FieldCacheSource) */
+  @Override
   public boolean cachedFieldSourceEquals(FieldCacheSource o) {
     if (o.getClass() !=  IntFieldSource.class) {
       return false;
@@ -105,6 +112,7 @@
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.FieldCacheSource#cachedFieldSourceHashCode() */
+  @Override
   public int cachedFieldSourceHashCode() {
     return parser==null ? 
       Integer.class.hashCode() : parser.getClass().hashCode();

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/MultiValueSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/MultiValueSource.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/MultiValueSource.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/MultiValueSource.java Thu Oct 29 21:29:47 2009
@@ -42,6 +42,7 @@
     this.other = other;
   }
 
+  @Override
   public DocValues getValues(IndexReader reader) throws IOException {
 
     IndexReader[] subReaders = reader.getSequentialSubReaders();
@@ -54,10 +55,12 @@
     }
   }
 
+  @Override
   public String description() {
     return other.description();
   }
 
+  @Override
   public boolean equals(Object o) {
     if (o instanceof MultiValueSource) {
       return ((MultiValueSource) o).other.equals(other);
@@ -66,6 +69,7 @@
     }
   }
 
+  @Override
   public int hashCode() {
     return 31 * other.hashCode();
   }
@@ -86,36 +90,43 @@
       }
     }
     
+    @Override
     public float floatVal(int doc) {
       final int n = ReaderUtil.subIndex(doc, docStarts);
       return docValues[n].floatVal(doc-docStarts[n]);
     }
 
+    @Override
     public int intVal(int doc) {
       final int n = ReaderUtil.subIndex(doc, docStarts);
       return docValues[n].intVal(doc-docStarts[n]);
     }
 
+    @Override
     public long longVal(int doc) {
       final int n = ReaderUtil.subIndex(doc, docStarts);
       return docValues[n].longVal(doc-docStarts[n]);
     }
 
+    @Override
     public double doubleVal(int doc) {
       final int n = ReaderUtil.subIndex(doc, docStarts);
       return docValues[n].doubleVal(doc-docStarts[n]);
     }
 
+    @Override
     public String strVal(int doc) {
       final int n = ReaderUtil.subIndex(doc, docStarts);
       return docValues[n].strVal(doc-docStarts[n]);
     }
 
+    @Override
     public String toString(int doc) {
       final int n = ReaderUtil.subIndex(doc, docStarts);
       return docValues[n].toString(doc-docStarts[n]);
     }
 
+    @Override
     public Explanation explain(int doc) {
       final int n = ReaderUtil.subIndex(doc, docStarts);
       return docValues[n].explain(doc-docStarts[n]);

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/OrdFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/OrdFieldSource.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/OrdFieldSource.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/OrdFieldSource.java Thu Oct 29 21:29:47 2009
@@ -67,28 +67,34 @@
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.ValueSource#description() */
+  @Override
   public String description() {
     return "ord(" + field + ')';
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.ValueSource#getValues(org.apache.lucene.index.IndexReader) */
+  @Override
   public DocValues getValues(IndexReader reader) throws IOException {
     final int[] arr = FieldCache.DEFAULT.getStringIndex(reader, field).order;
     return new DocValues() {
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#floatVal(int) */
+      @Override
       public float floatVal(int doc) {
         return (float)arr[doc];
       }
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#strVal(int) */
+      @Override
       public String strVal(int doc) {
         // the string value of the ordinal, not the string itself
         return Integer.toString(arr[doc]);
       }
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#toString(int) */
+      @Override
       public String toString(int doc) {
         return description() + '=' + intVal(doc);
       }
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#getInnerArray() */
+      @Override
       Object getInnerArray() {
         return arr;
       }
@@ -96,6 +102,7 @@
   }
 
   /*(non-Javadoc) @see java.lang.Object#equals(java.lang.Object) */
+  @Override
   public boolean equals(Object o) {
     if (o.getClass() !=  OrdFieldSource.class) return false;
     OrdFieldSource other = (OrdFieldSource)o;
@@ -105,6 +112,7 @@
   private static final int hcode = OrdFieldSource.class.hashCode();
   
   /*(non-Javadoc) @see java.lang.Object#hashCode() */
+  @Override
   public int hashCode() {
     return hcode + field.hashCode();
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ReverseOrdFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ReverseOrdFieldSource.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ReverseOrdFieldSource.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ReverseOrdFieldSource.java Thu Oct 29 21:29:47 2009
@@ -68,11 +68,13 @@
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.ValueSource#description() */
+  @Override
   public String description() {
     return "rord("+field+')';
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.ValueSource#getValues(org.apache.lucene.index.IndexReader) */
+  @Override
   public DocValues getValues(IndexReader reader) throws IOException {
     final FieldCache.StringIndex sindex = FieldCache.DEFAULT.getStringIndex(reader, field);
 
@@ -81,23 +83,28 @@
 
     return new DocValues() {
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#floatVal(int) */
+      @Override
       public float floatVal(int doc) {
         return (float)(end - arr[doc]);
       }
       /* (non-Javadoc) @see org.apache.lucene.search.function.DocValues#intVal(int) */
+      @Override
       public int intVal(int doc) {
         return end - arr[doc];
       }
       /* (non-Javadoc) @see org.apache.lucene.search.function.DocValues#strVal(int) */
+      @Override
       public String strVal(int doc) {
         // the string value of the ordinal, not the string itself
         return Integer.toString(intVal(doc));
       }
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#toString(int) */
+      @Override
       public String toString(int doc) {
         return description() + '=' + strVal(doc);
       }
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#getInnerArray() */
+      @Override
       Object getInnerArray() {
         return arr;
       }
@@ -105,6 +112,7 @@
   }
 
   /*(non-Javadoc) @see java.lang.Object#equals(java.lang.Object) */
+  @Override
   public boolean equals(Object o) {
     if (o.getClass() !=  ReverseOrdFieldSource.class) return false;
     ReverseOrdFieldSource other = (ReverseOrdFieldSource)o;
@@ -114,6 +122,7 @@
   private static final int hcode = ReverseOrdFieldSource.class.hashCode();
   
   /*(non-Javadoc) @see java.lang.Object#hashCode() */
+  @Override
   public int hashCode() {
     return hcode + field.hashCode();
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ShortFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ShortFieldSource.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ShortFieldSource.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ShortFieldSource.java Thu Oct 29 21:29:47 2009
@@ -66,27 +66,33 @@
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.ValueSource#description() */
+  @Override
   public String description() {
     return "short(" + super.description() + ')';
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.FieldCacheSource#getCachedValues(org.apache.lucene.search.FieldCache, java.lang.String, org.apache.lucene.index.IndexReader) */
+  @Override
   public DocValues getCachedFieldValues (FieldCache cache, String field, IndexReader reader) throws IOException {
     final short[] arr = cache.getShorts(reader, field, parser);
     return new DocValues() {
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#floatVal(int) */
+      @Override
       public float floatVal(int doc) { 
         return (float) arr[doc];
       }
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#intVal(int) */
+      @Override
       public  int intVal(int doc) { 
         return arr[doc]; 
       }
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#toString(int) */
+      @Override
       public String toString(int doc) { 
         return  description() + '=' + intVal(doc);  
       }
       /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#getInnerArray() */
+      @Override
       Object getInnerArray() {
         return arr;
       }
@@ -94,6 +100,7 @@
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.FieldCacheSource#cachedFieldSourceEquals(org.apache.lucene.search.function.FieldCacheSource) */
+  @Override
   public boolean cachedFieldSourceEquals(FieldCacheSource o) {
     if (o.getClass() !=  ShortFieldSource.class) {
       return false;
@@ -105,6 +112,7 @@
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.function.FieldCacheSource#cachedFieldSourceHashCode() */
+  @Override
   public int cachedFieldSourceHashCode() {
     return parser==null ? 
       Short.class.hashCode() : parser.getClass().hashCode();

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ValueSource.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ValueSource.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ValueSource.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/function/ValueSource.java Thu Oct 29 21:29:47 2009
@@ -54,6 +54,7 @@
   public abstract String description();
 
   /* (non-Javadoc) @see java.lang.Object#toString() */
+  @Override
   public String toString() {
     return description();
   }
@@ -62,12 +63,14 @@
    * Needed for possible caching of query results - used by {@link ValueSourceQuery#equals(Object)}.
    * @see Object#equals(Object)
    */
+  @Override
   public abstract boolean equals(Object o);
 
   /**
    * Needed for possible caching of query results - used by {@link ValueSourceQuery#hashCode()}.
    * @see Object#hashCode()
    */
+  @Override
   public abstract int hashCode();
   
 }



Mime
View raw message