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 [5/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/index/TermsHash.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsHash.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsHash.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsHash.java Thu Oct 29 21:29:47 2009
@@ -68,6 +68,7 @@
     postingsFreeChunk = (int) (DocumentsWriter.BYTE_BLOCK_SIZE / bytesPerPosting);
   }
 
+  @Override
   InvertedDocConsumerPerThread addThread(DocInverterPerThread docInverterPerThread) {
     return new TermsHashPerThread(docInverterPerThread, this, nextTermsHash, null);
   }
@@ -76,11 +77,13 @@
     return new TermsHashPerThread(docInverterPerThread, this, nextTermsHash, primaryPerThread);
   }
 
+  @Override
   void setFieldInfos(FieldInfos fieldInfos) {
     this.fieldInfos = fieldInfos;
     consumer.setFieldInfos(fieldInfos);
   }
 
+  @Override
   synchronized public void abort() {
     consumer.abort();
     if (nextTermsHash != null)
@@ -99,12 +102,14 @@
     }
   }
 
+  @Override
   synchronized void closeDocStore(SegmentWriteState state) throws IOException {
     consumer.closeDocStore(state);
     if (nextTermsHash != null)
       nextTermsHash.closeDocStore(state);
   }
 
+  @Override
   synchronized void flush(Map<InvertedDocConsumerPerThread,Collection<InvertedDocConsumerPerField>> threadsAndFields, final SegmentWriteState state) throws IOException {
     Map childThreadsAndFields = new HashMap();
     Map nextThreadsAndFields;
@@ -152,6 +157,7 @@
       nextTermsHash.flush(nextThreadsAndFields, state);
   }
 
+  @Override
   synchronized public boolean freeRAM() {
 
     if (!trackAllocations)

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsHashPerField.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsHashPerField.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsHashPerField.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsHashPerField.java Thu Oct 29 21:29:47 2009
@@ -100,6 +100,7 @@
       nextPerField.reset();
   }
 
+  @Override
   synchronized public void abort() {
     reset();
     if (nextPerField != null)
@@ -248,6 +249,7 @@
   private boolean doCall;
   private boolean doNextCall;
 
+  @Override
   void start(Fieldable f) {
     termAtt = fieldState.attributeSource.addAttribute(TermAttribute.class);
     consumer.start(f);
@@ -256,6 +258,7 @@
     }
   }
   
+  @Override
   boolean start(Fieldable[] fields, int count) throws IOException {
     doCall = consumer.start(fields, count);
     if (nextPerField != null)
@@ -339,6 +342,7 @@
   }
 
   // Primary entry point (for first TermsHash)
+  @Override
   void add() throws IOException {
 
     assert !postingsCompacted;
@@ -507,6 +511,7 @@
     writeByte(stream, (byte) i);
   }
 
+  @Override
   void finish() throws IOException {
     consumer.finish();
     if (nextPerField != null)

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsHashPerThread.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsHashPerThread.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsHashPerThread.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermsHashPerThread.java Thu Oct 29 21:29:47 2009
@@ -58,10 +58,12 @@
       nextPerThread = null;
   }
 
+  @Override
   InvertedDocConsumerPerField addField(DocInverterPerField docInverterPerField, final FieldInfo fieldInfo) {
     return new TermsHashPerField(docInverterPerField, this, nextPerThread, fieldInfo);
   }
 
+  @Override
   synchronized public void abort() {
     reset(true);
     consumer.abort();
@@ -83,12 +85,14 @@
     return true;
   }
 
+  @Override
   public void startDocument() throws IOException {
     consumer.startDocument();
     if (nextPerThread != null)
       nextPerThread.consumer.startDocument();
   }
 
+  @Override
   public DocumentsWriter.DocWriter finishDocument() throws IOException {
     final DocumentsWriter.DocWriter doc = consumer.finishDocument();
 

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/messages/MessageImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/messages/MessageImpl.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/messages/MessageImpl.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/messages/MessageImpl.java Thu Oct 29 21:29:47 2009
@@ -57,6 +57,7 @@
     return NLS.getLocalizedMessage(getKey(), locale, getArguments());
   }
 
+  @Override
   public String toString() {
     Object[] args = getArguments();
     String argsString = "";

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/BooleanClause.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/BooleanClause.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/BooleanClause.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/BooleanClause.java Thu Oct 29 21:29:47 2009
@@ -24,7 +24,7 @@
   public static enum Occur {
 
     /** Use this operator for clauses that <i>must</i> appear in the matching documents. */
-    MUST     { public String toString() { return "+"; } },
+    MUST     { @Override public String toString() { return "+"; } },
 
     /** Use this operator for clauses that <i>should</i> appear in the 
      * matching documents. For a BooleanQuery with no <code>MUST</code> 
@@ -32,12 +32,12 @@
      * for the BooleanQuery to match.
      * @see BooleanQuery#setMinimumNumberShouldMatch
      */
-    SHOULD   { public String toString() { return "";  } },
+    SHOULD   { @Override public String toString() { return "";  } },
 
     /** Use this operator for clauses that <i>must not</i> appear in the matching documents.
      * Note that it is not possible to search for queries that only consist
      * of a <code>MUST_NOT</code> clause. */
-    MUST_NOT { public String toString() { return "-"; } };
+    MUST_NOT { @Override public String toString() { return "-"; } };
 
   }
 
@@ -84,6 +84,7 @@
 
 
   /** Returns true if <code>o</code> is equal to this. */
+  @Override
   public boolean equals(Object o) {
     if (o == null || !(o instanceof BooleanClause))
       return false;
@@ -93,11 +94,13 @@
   }
 
   /** Returns a hash code value for this object.*/
+  @Override
   public int hashCode() {
     return query.hashCode() ^ (Occur.MUST == occur?1:0) ^ (Occur.MUST_NOT == occur?2:0);
   }
 
 
+  @Override
   public String toString() {
     return occur.toString() + query.toString();
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/BooleanQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/BooleanQuery.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/BooleanQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/BooleanQuery.java Thu Oct 29 21:29:47 2009
@@ -40,6 +40,7 @@
    */
   public static class TooManyClauses extends RuntimeException {
     public TooManyClauses() {}
+    @Override
     public String getMessage() {
       return "maxClauseCount is set to " + maxClauseCount;
     }
@@ -89,10 +90,12 @@
 
   // Implement coord disabling.
   // Inherit javadoc.
+  @Override
   public Similarity getSimilarity(Searcher searcher) {
     Similarity result = super.getSimilarity(searcher);
     if (disableCoord) {                           // disable coord as requested
       result = new SimilarityDelegator(result) {
+          @Override
           public float coord(int overlap, int maxOverlap) {
             return 1.0f;
           }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/BooleanScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/BooleanScorer.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/BooleanScorer.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/BooleanScorer.java Thu Oct 29 21:29:47 2009
@@ -66,6 +66,8 @@
       this.mask = mask;
       this.bucketTable = bucketTable;
     }
+    
+    @Override
     public final void collect(final int doc) throws IOException {
       final BucketTable table = bucketTable;
       final int i = doc & BucketTable.MASK;
@@ -88,14 +90,17 @@
       }
     }
     
+    @Override
     public void setNextReader(IndexReader reader, int docBase) {
       // not needed by this implementation
     }
     
+    @Override
     public void setScorer(Scorer scorer) throws IOException {
       this.scorer = scorer;
     }
     
+    @Override
     public boolean acceptsDocsOutOfOrder() {
       return true;
     }
@@ -113,14 +118,16 @@
     
     public BucketScorer() { super(null); }
     
+    @Override
     public int advance(int target) throws IOException { return NO_MORE_DOCS; }
 
+    @Override
     public int docID() { return doc; }
 
-    public Explanation explain(int doc) throws IOException { return null; }
-    
+    @Override
     public int nextDoc() throws IOException { return NO_MORE_DOCS; }
     
+    @Override
     public float score() throws IOException { return score; }
     
   }
@@ -213,6 +220,7 @@
   }
 
   // firstDocID is ignored since nextDoc() initializes 'current'
+  @Override
   protected boolean score(Collector collector, int max, int firstDocID) throws IOException {
     boolean more;
     Bucket tmp;
@@ -268,18 +276,17 @@
     return false;
   }
   
+  @Override
   public int advance(int target) throws IOException {
     throw new UnsupportedOperationException();
   }
 
+  @Override
   public int docID() {
     return doc;
   }
 
-  public Explanation explain(int doc) {
-    throw new UnsupportedOperationException();
-  }
-
+  @Override
   public int nextDoc() throws IOException {
     boolean more;
     do {
@@ -313,14 +320,17 @@
     return doc = NO_MORE_DOCS;
   }
 
+  @Override
   public float score() {
     return current.score * coordFactors[current.coord];
   }
 
+  @Override
   public void score(Collector collector) throws IOException {
     score(collector, Integer.MAX_VALUE, nextDoc());
   }
   
+  @Override
   public String toString() {
     StringBuilder buffer = new StringBuilder();
     buffer.append("boolean(");

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/BooleanScorer2.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/BooleanScorer2.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/BooleanScorer2.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/BooleanScorer2.java Thu Oct 29 21:29:47 2009
@@ -113,6 +113,8 @@
       super(scorer.getSimilarity());
       this.scorer = scorer;
     }
+
+    @Override
     public float score() throws IOException {
       int doc = docID();
       if (doc >= lastScoredDoc) {
@@ -124,18 +126,21 @@
       }
       return lastDocScore;
     }
+
+    @Override
     public int docID() {
       return scorer.docID();
     }
+
+    @Override
     public int nextDoc() throws IOException {
       return scorer.nextDoc();
     }
+
+    @Override
     public int advance(int target) throws IOException {
       return scorer.advance(target);
     }
-    public Explanation explain(int docNr) throws IOException {
-      return scorer.explain(docNr);
-    }
   }
 
   private Scorer countingDisjunctionSumScorer(final List<Scorer> scorers,
@@ -146,7 +151,7 @@
       // Save the score of lastScoredDoc, so that we don't compute it more than
       // once in score().
       private float lastDocScore = Float.NaN;
-      public float score() throws IOException {
+      @Override public float score() throws IOException {
         int doc = docID();
         if (doc >= lastScoredDoc) {
           if (doc > lastScoredDoc) {
@@ -170,7 +175,7 @@
       // Save the score of lastScoredDoc, so that we don't compute it more than
       // once in score().
       private float lastDocScore = Float.NaN;
-      public float score() throws IOException {
+      @Override public float score() throws IOException {
         int doc = docID();
         if (doc >= lastScoredDoc) {
           if (doc > lastScoredDoc) {
@@ -262,8 +267,8 @@
 
   /** Scores and collects all matching documents.
    * @param collector The collector to which all matching documents are passed through.
-   * <br>When this method is used the {@link #explain(int)} method should not be used.
    */
+  @Override
   public void score(Collector collector) throws IOException {
     collector.setScorer(this);
     while ((doc = countingSumScorer.nextDoc()) != NO_MORE_DOCS) {
@@ -271,6 +276,7 @@
     }
   }
   
+  @Override
   protected boolean score(Collector collector, int max, int firstDocID) throws IOException {
     doc = firstDocID;
     collector.setScorer(this);
@@ -281,14 +287,17 @@
     return doc != NO_MORE_DOCS;
   }
 
+  @Override
   public int docID() {
     return doc;
   }
   
+  @Override
   public int nextDoc() throws IOException {
     return doc = countingSumScorer.nextDoc();
   }
   
+  @Override
   public float score() throws IOException {
     coordinator.nrMatchers = 0;
     float sum = countingSumScorer.score();
@@ -296,22 +305,10 @@
     return sum * coordinator.coordFactors[coordinator.nrMatchers];
   }
 
+  @Override
   public int advance(int target) throws IOException {
     return doc = countingSumScorer.advance(target);
   }
-  
-  /** Throws an UnsupportedOperationException.
-   * TODO: Implement an explanation of the coordination factor.
-   * @param doc The document number for the explanation.
-   * @throws UnsupportedOperationException
-   */
-  public Explanation explain(int doc) {
-    throw new UnsupportedOperationException();
- /* How to explain the coordination factor?
-    initCountingSumScorer();
-    return countingSumScorer.explain(doc); // misses coord factor. 
-  */
-  }
 }
 
 

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/CachingSpanFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/CachingSpanFilter.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/CachingSpanFilter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/CachingSpanFilter.java Thu Oct 29 21:29:47 2009
@@ -42,6 +42,7 @@
     this.filter = filter;
   }
 
+  @Override
   public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
     SpanFilterResult result = getCachedResult(reader);
     return result != null ? result.getDocIdSet() : null;
@@ -64,19 +65,23 @@
   }
 
 
+  @Override
   public SpanFilterResult bitSpans(IndexReader reader) throws IOException {
     return getCachedResult(reader);
   }
 
+  @Override
   public String toString() {
     return "CachingSpanFilter("+filter+")";
   }
 
+  @Override
   public boolean equals(Object o) {
     if (!(o instanceof CachingSpanFilter)) return false;
     return this.filter.equals(((CachingSpanFilter)o).filter);
   }
 
+  @Override
   public int hashCode() {
     return filter.hashCode() ^ 0x1117BF25;
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/CachingWrapperFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/CachingWrapperFilter.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/CachingWrapperFilter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/CachingWrapperFilter.java Thu Oct 29 21:29:47 2009
@@ -61,6 +61,7 @@
     }
   }
   
+  @Override
   public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
     if (cache == null) {
       cache = new WeakHashMap<IndexReader, DocIdSet>();
@@ -86,15 +87,18 @@
     return docIdSet;
   }
 
+  @Override
   public String toString() {
     return "CachingWrapperFilter("+filter+")";
   }
 
+  @Override
   public boolean equals(Object o) {
     if (!(o instanceof CachingWrapperFilter)) return false;
     return this.filter.equals(((CachingWrapperFilter)o).filter);
   }
 
+  @Override
   public int hashCode() {
     return filter.hashCode() ^ 0x1117BF25;  
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ComplexExplanation.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ComplexExplanation.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ComplexExplanation.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ComplexExplanation.java Thu Oct 29 21:29:47 2009
@@ -52,11 +52,13 @@
    * </p>
    * @see #getMatch
    */
+  @Override
   public boolean isMatch() {
     Boolean m = getMatch();
     return (null != m ? m.booleanValue() : super.isMatch());
   }
 
+  @Override
   protected String getSummary() {
     if (null == getMatch())
       return super.getSummary();

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ConjunctionScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ConjunctionScorer.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ConjunctionScorer.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ConjunctionScorer.java Thu Oct 29 21:29:47 2009
@@ -100,6 +100,7 @@
     return doc;
   }
   
+  @Override
   public int advance(int target) throws IOException {
     if (lastDoc == NO_MORE_DOCS) {
       return lastDoc;
@@ -109,14 +110,12 @@
     return lastDoc = doNext();
   }
 
+  @Override
   public int docID() {
     return lastDoc;
   }
   
-  public Explanation explain(int doc) {
-    throw new UnsupportedOperationException();
-  }
-
+  @Override
   public int nextDoc() throws IOException {
     if (lastDoc == NO_MORE_DOCS) {
       return lastDoc;
@@ -127,6 +126,7 @@
     return lastDoc = doNext();
   }
   
+  @Override
   public float score() throws IOException {
     float sum = 0.0f;
     for (int i = 0; i < scorers.length; i++) {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ConstantScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ConstantScoreQuery.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ConstantScoreQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ConstantScoreQuery.java Thu Oct 29 21:29:47 2009
@@ -39,10 +39,12 @@
     return filter;
   }
 
+  @Override
   public Query rewrite(IndexReader reader) throws IOException {
     return this;
   }
 
+  @Override
   public void extractTerms(Set<Term> terms) {
     // OK to not add any terms when used for MultiSearcher,
     // but may not be OK for highlighting
@@ -57,28 +59,34 @@
       this.similarity = getSimilarity(searcher);
     }
 
+    @Override
     public Query getQuery() {
       return ConstantScoreQuery.this;
     }
 
+    @Override
     public float getValue() {
       return queryWeight;
     }
 
+    @Override
     public float sumOfSquaredWeights() throws IOException {
       queryWeight = getBoost();
       return queryWeight * queryWeight;
     }
 
+    @Override
     public void normalize(float norm) {
       this.queryNorm = norm;
       queryWeight *= this.queryNorm;
     }
 
+    @Override
     public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException {
       return new ConstantScorer(similarity, reader, this);
     }
 
+    @Override
     public Explanation explain(IndexReader reader, int doc) throws IOException {
       
       ConstantScorer cs = new ConstantScorer(similarity, reader, this);
@@ -124,38 +132,41 @@
       }
     }
 
+    @Override
     public int nextDoc() throws IOException {
       return docIdSetIterator.nextDoc();
     }
     
+    @Override
     public int docID() {
       return docIdSetIterator.docID();
     }
 
+    @Override
     public float score() throws IOException {
       return theScore;
     }
 
+    @Override
     public int advance(int target) throws IOException {
       return docIdSetIterator.advance(target);
     }
-    
-    public Explanation explain(int doc) throws IOException {
-      throw new UnsupportedOperationException();
-    }
   }
 
+  @Override
   public Weight createWeight(Searcher searcher) {
     return new ConstantScoreQuery.ConstantWeight(searcher);
   }
 
   /** Prints a user-readable version of this query. */
+  @Override
   public String toString(String field) {
     return "ConstantScore(" + filter.toString()
       + (getBoost()==1.0 ? ")" : "^" + getBoost());
   }
 
   /** Returns true if <code>o</code> is equal to this. */
+  @Override
   public boolean equals(Object o) {
     if (this == o) return true;
     if (!(o instanceof ConstantScoreQuery)) return false;
@@ -164,6 +175,7 @@
   }
 
   /** Returns a hash code value for this object. */
+  @Override
   public int hashCode() {
     // Simple add is OK since no existing filter hashcode has a float component.
     return filter.hashCode() + Float.floatToIntBits(getBoost());

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/DefaultSimilarity.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/DefaultSimilarity.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/DefaultSimilarity.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/DefaultSimilarity.java Thu Oct 29 21:29:47 2009
@@ -31,6 +31,7 @@
    *
    *  <p><b>WARNING</b>: This API is new and experimental, and may suddenly
    *  change.</p> */
+  @Override
   public float computeNorm(String field, FieldInvertState state) {
     final int numTerms;
     if (discountOverlaps)
@@ -41,31 +42,37 @@
   }
   
   /** Implemented as <code>1/sqrt(numTerms)</code>. */
+  @Override
   public float lengthNorm(String fieldName, int numTerms) {
     return (float)(1.0 / Math.sqrt(numTerms));
   }
   
   /** Implemented as <code>1/sqrt(sumOfSquaredWeights)</code>. */
+  @Override
   public float queryNorm(float sumOfSquaredWeights) {
     return (float)(1.0 / Math.sqrt(sumOfSquaredWeights));
   }
 
   /** Implemented as <code>sqrt(freq)</code>. */
+  @Override
   public float tf(float freq) {
     return (float)Math.sqrt(freq);
   }
     
   /** Implemented as <code>1 / (distance + 1)</code>. */
+  @Override
   public float sloppyFreq(int distance) {
     return 1.0f / (distance + 1);
   }
     
   /** Implemented as <code>log(numDocs/(docFreq+1)) + 1</code>. */
+  @Override
   public float idf(int docFreq, int numDocs) {
     return (float)(Math.log(numDocs/(double)(docFreq+1)) + 1.0);
   }
     
   /** Implemented as <code>overlap / maxOverlap</code>. */
+  @Override
   public float coord(int overlap, int maxOverlap) {
     return overlap / (float)maxOverlap;
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/DisjunctionMaxScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/DisjunctionMaxScorer.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/DisjunctionMaxScorer.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/DisjunctionMaxScorer.java Thu Oct 29 21:29:47 2009
@@ -62,6 +62,7 @@
     heapify();
   }
 
+  @Override
   public int nextDoc() throws IOException {
     if (numScorers == 0) return doc = NO_MORE_DOCS;
     while (subScorers[0].docID() == doc) {
@@ -78,6 +79,7 @@
     return doc = subScorers[0].docID();
   }
 
+  @Override
   public int docID() {
     return doc;
   }
@@ -85,6 +87,7 @@
   /** Determine the current document score.  Initially invalid, until {@link #next()} is called the first time.
    * @return the score of the current generated document
    */
+  @Override
   public float score() throws IOException {
     int doc = subScorers[0].docID();
     float[] sum = { subScorers[0].score() }, max = { sum[0] };
@@ -105,6 +108,7 @@
     }
   }
 
+  @Override
   public int advance(int target) throws IOException {
     if (numScorers == 0) return doc = NO_MORE_DOCS;
     while (subScorers[0].docID() < target) {
@@ -120,14 +124,6 @@
     return doc = subScorers[0].docID();
   }
 
-  /** Explain a score that we computed.  UNSUPPORTED -- see explanation capability in DisjunctionMaxQuery.
-   * @param doc the number of a document we scored
-   * @return the Explanation for our score
-   */
-  public Explanation explain(int doc) throws IOException {
-    throw new UnsupportedOperationException();
-  }
-
   // Organize subScorers into a min heap with scorers generating the earliest document on top.
   private void heapify() {
     for (int i = (numScorers >> 1) - 1; i >= 0; i--) {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/DisjunctionSumScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/DisjunctionSumScorer.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/DisjunctionSumScorer.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/DisjunctionSumScorer.java Thu Oct 29 21:29:47 2009
@@ -109,7 +109,6 @@
 
   /** Scores and collects all matching documents.
    * @param collector The collector to which all matching documents are passed through.
-   * <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);
@@ -207,8 +206,6 @@
   /**
    * Advances to the first match beyond the current whose document number is
    * greater than or equal to a given target. <br>
-   * When this method is used the {@link #explain(int)} method should not be
-   * used. <br>
    * The implementation uses the skipTo() method on the subscorers.
    * 
    * @param target
@@ -216,6 +213,7 @@
    * @return the document whose number is greater than or equal to the given
    *         target, or -1 if none exist.
    */
+  @Override
   public int advance(int target) throws IOException {
     if (scorerDocQueue.size() < minimumNrMatchers) {
       return currentDoc = NO_MORE_DOCS;
@@ -233,31 +231,4 @@
       }
     } while (true);
   }
-  
-  /** @return An explanation for the score of a given document. */
-  public Explanation explain(int doc) throws IOException {
-    Explanation res = new Explanation();
-    Iterator ssi = subScorers.iterator();
-    float sumScore = 0.0f;
-    int nrMatches = 0;
-    while (ssi.hasNext()) {
-      Explanation es = ((Scorer) ssi.next()).explain(doc);
-      if (es.getValue() > 0.0f) { // indicates match
-        sumScore += es.getValue();
-        nrMatches++;
-      }
-      res.addDetail(es);
-    }
-    if (nrMatchers >= minimumNrMatchers) {
-      res.setValue(sumScore);
-      res.setDescription("sum over at least " + minimumNrMatchers
-                         + " of " + subScorers.size() + ":");
-    } else {
-      res.setValue(0.0f);
-      res.setDescription(nrMatches + " match(es) but at least "
-                         + minimumNrMatchers + " of "
-                         + subScorers.size() + " needed");
-    }
-    return res;
-  }
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/DocIdSet.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/DocIdSet.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/DocIdSet.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/DocIdSet.java Thu Oct 29 21:29:47 2009
@@ -29,8 +29,11 @@
   public static final DocIdSet EMPTY_DOCIDSET = new DocIdSet() {
     
     private final DocIdSetIterator iterator = new DocIdSetIterator() {
+      @Override
       public int advance(int target) throws IOException { return NO_MORE_DOCS; }
+      @Override
       public int docID() { return NO_MORE_DOCS; }
+      @Override
       public int nextDoc() throws IOException { return NO_MORE_DOCS; }
     };
     

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ExactPhraseScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ExactPhraseScorer.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ExactPhraseScorer.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/ExactPhraseScorer.java Thu Oct 29 21:29:47 2009
@@ -27,6 +27,7 @@
     super(weight, docs, offsets, similarity, norms);
   }
 
+  @Override
   protected final float phraseFreq() throws IOException {
     // sort list with pq
     pq.clear();

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Explanation.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Explanation.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Explanation.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/Explanation.java Thu Oct 29 21:29:47 2009
@@ -82,6 +82,7 @@
   }
 
   /** Render an explanation as text. */
+  @Override
   public String toString() {
     return toString(0);
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCache.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCache.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCache.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCache.java Thu Oct 29 21:29:47 2009
@@ -160,6 +160,7 @@
     protected Object readResolve() {
       return DEFAULT_BYTE_PARSER;
     }
+    @Override
     public String toString() { 
       return FieldCache.class.getName()+".DEFAULT_BYTE_PARSER"; 
     }
@@ -178,6 +179,7 @@
     protected Object readResolve() {
       return DEFAULT_SHORT_PARSER;
     }
+    @Override
     public String toString() { 
       return FieldCache.class.getName()+".DEFAULT_SHORT_PARSER"; 
     }
@@ -196,6 +198,7 @@
     protected Object readResolve() {
       return DEFAULT_INT_PARSER;
     }
+    @Override
     public String toString() { 
       return FieldCache.class.getName()+".DEFAULT_INT_PARSER"; 
     }
@@ -211,6 +214,7 @@
     protected Object readResolve() {
       return DEFAULT_FLOAT_PARSER;
     }
+    @Override
     public String toString() { 
       return FieldCache.class.getName()+".DEFAULT_FLOAT_PARSER"; 
     }
@@ -224,6 +228,7 @@
     protected Object readResolve() {
       return DEFAULT_LONG_PARSER;
     }
+    @Override
     public String toString() { 
       return FieldCache.class.getName()+".DEFAULT_LONG_PARSER"; 
     }
@@ -239,6 +244,7 @@
     protected Object readResolve() {
       return DEFAULT_DOUBLE_PARSER;
     }
+    @Override
     public String toString() { 
       return FieldCache.class.getName()+".DEFAULT_DOUBLE_PARSER"; 
     }
@@ -258,6 +264,7 @@
     protected Object readResolve() {
       return NUMERIC_UTILS_INT_PARSER;
     }
+    @Override
     public String toString() { 
       return FieldCache.class.getName()+".NUMERIC_UTILS_INT_PARSER"; 
     }
@@ -277,6 +284,7 @@
     protected Object readResolve() {
       return NUMERIC_UTILS_FLOAT_PARSER;
     }
+    @Override
     public String toString() { 
       return FieldCache.class.getName()+".NUMERIC_UTILS_FLOAT_PARSER"; 
     }
@@ -296,6 +304,7 @@
     protected Object readResolve() {
       return NUMERIC_UTILS_LONG_PARSER;
     }
+    @Override
     public String toString() { 
       return FieldCache.class.getName()+".NUMERIC_UTILS_LONG_PARSER"; 
     }
@@ -315,6 +324,7 @@
     protected Object readResolve() {
       return NUMERIC_UTILS_DOUBLE_PARSER;
     }
+    @Override
     public String toString() { 
       return FieldCache.class.getName()+".NUMERIC_UTILS_DOUBLE_PARSER"; 
     }
@@ -548,6 +558,7 @@
     }
     
     
+    @Override
     public String toString() {
       StringBuilder b = new StringBuilder();
       b.append("'").append(getReaderKey()).append("'=>");

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCacheImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCacheImpl.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCacheImpl.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCacheImpl.java Thu Oct 29 21:29:47 2009
@@ -111,10 +111,15 @@
 //         }
 
     }
+    @Override
     public Object getReaderKey() { return readerKey; }
+    @Override
     public String getFieldName() { return fieldName; }
+    @Override
     public Class<?> getCacheType() { return cacheType; }
+    @Override
     public Object getCustom() { return custom; }
+    @Override
     public Object getValue() { return value; }
   }
 
@@ -216,6 +221,7 @@
     }
 
     /** Two of these are equal iff they reference the same field and type. */
+    @Override
     public boolean equals (Object o) {
       if (o instanceof Entry) {
         Entry other = (Entry) o;
@@ -231,6 +237,7 @@
     }
 
     /** Composes a hashcode based on the field and type. */
+    @Override
     public int hashCode() {
       return field.hashCode() ^ (custom==null ? 0 : custom.hashCode());
     }
@@ -251,6 +258,7 @@
     ByteCache(FieldCache wrapper) {
       super(wrapper);
     }
+    @Override
     protected Object createValue(IndexReader reader, Entry entryKey)
         throws IOException {
       Entry entry = entryKey;
@@ -303,6 +311,7 @@
       super(wrapper);
     }
 
+    @Override
     protected Object createValue(IndexReader reader, Entry entryKey)
         throws IOException {
       Entry entry =  entryKey;
@@ -355,6 +364,7 @@
       super(wrapper);
     }
 
+    @Override
     protected Object createValue(IndexReader reader, Entry entryKey)
         throws IOException {
       Entry entry = entryKey;
@@ -425,6 +435,7 @@
       super(wrapper);
     }
 
+    @Override
     protected Object createValue(IndexReader reader, Entry entryKey)
         throws IOException {
       Entry entry = entryKey;
@@ -492,6 +503,7 @@
       super(wrapper);
     }
 
+    @Override
     protected Object createValue(IndexReader reader, Entry entry)
         throws IOException {
       String field = entry.field;
@@ -558,6 +570,7 @@
       super(wrapper);
     }
 
+    @Override
     protected Object createValue(IndexReader reader, Entry entryKey)
         throws IOException {
       Entry entry = entryKey;
@@ -616,6 +629,7 @@
       super(wrapper);
     }
 
+    @Override
     protected Object createValue(IndexReader reader, Entry entryKey)
         throws IOException {
       String field = StringHelper.intern(entryKey.field);
@@ -656,6 +670,7 @@
       super(wrapper);
     }
 
+    @Override
     protected Object createValue(IndexReader reader, Entry entryKey)
         throws IOException {
       String field = StringHelper.intern(entryKey.field);

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java Thu Oct 29 21:29:47 2009
@@ -70,6 +70,7 @@
   }
   
   /** This method is implemented for each data type */
+  @Override
   public abstract DocIdSet getDocIdSet(IndexReader reader) throws IOException;
 
   /**
@@ -79,6 +80,7 @@
    */
   public static FieldCacheRangeFilter<String> newStringRange(String field, String lowerVal, String upperVal, boolean includeLower, boolean includeUpper) {
     return new FieldCacheRangeFilter<String>(field, null, lowerVal, upperVal, includeLower, includeUpper) {
+      @Override
       public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
         final FieldCache.StringIndex fcsi = FieldCache.DEFAULT.getStringIndex(reader, field);
         final int lowerPoint = fcsi.binarySearchLookup(lowerVal);
@@ -120,6 +122,7 @@
         // for this DocIdSet, we can ignore deleted docs
         // because deleted docs have an order of 0 (null entry in StringIndex)
         return new FieldCacheDocIdSet(reader, true) {
+          @Override
           final boolean matchDoc(int doc) {
             return fcsi.order[doc] >= inclusiveLowerPoint && fcsi.order[doc] <= inclusiveUpperPoint;
           }
@@ -144,6 +147,7 @@
    */
   public static FieldCacheRangeFilter<Byte> newByteRange(String field, FieldCache.ByteParser parser, Byte lowerVal, Byte upperVal, boolean includeLower, boolean includeUpper) {
     return new FieldCacheRangeFilter<Byte>(field, parser, lowerVal, upperVal, includeLower, includeUpper) {
+      @Override
       public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
         final byte inclusiveLowerPoint, inclusiveUpperPoint;
         if (lowerVal != null) {
@@ -169,6 +173,7 @@
         final byte[] values = FieldCache.DEFAULT.getBytes(reader, field, (FieldCache.ByteParser) parser);
         // we only respect deleted docs if the range contains 0
         return new FieldCacheDocIdSet(reader, !(inclusiveLowerPoint <= 0 && inclusiveUpperPoint >= 0)) {
+          @Override
           boolean matchDoc(int doc) {
             return values[doc] >= inclusiveLowerPoint && values[doc] <= inclusiveUpperPoint;
           }
@@ -193,6 +198,7 @@
    */
   public static FieldCacheRangeFilter<Short> newShortRange(String field, FieldCache.ShortParser parser, Short lowerVal, Short upperVal, boolean includeLower, boolean includeUpper) {
     return new FieldCacheRangeFilter<Short>(field, parser, lowerVal, upperVal, includeLower, includeUpper) {
+      @Override
       public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
         final short inclusiveLowerPoint, inclusiveUpperPoint;
         if (lowerVal != null) {
@@ -218,6 +224,7 @@
         final short[] values = FieldCache.DEFAULT.getShorts(reader, field, (FieldCache.ShortParser) parser);
         // ignore deleted docs if range doesn't contain 0
         return new FieldCacheDocIdSet(reader, !(inclusiveLowerPoint <= 0 && inclusiveUpperPoint >= 0)) {
+          @Override
           boolean matchDoc(int doc) {
             return values[doc] >= inclusiveLowerPoint && values[doc] <= inclusiveUpperPoint;
           }
@@ -242,6 +249,7 @@
    */
   public static FieldCacheRangeFilter<Integer> newIntRange(String field, FieldCache.IntParser parser, Integer lowerVal, Integer upperVal, boolean includeLower, boolean includeUpper) {
     return new FieldCacheRangeFilter<Integer>(field, parser, lowerVal, upperVal, includeLower, includeUpper) {
+      @Override
       public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
         final int inclusiveLowerPoint, inclusiveUpperPoint;
         if (lowerVal != null) {
@@ -267,6 +275,7 @@
         final int[] values = FieldCache.DEFAULT.getInts(reader, field, (FieldCache.IntParser) parser);
         // ignore deleted docs if range doesn't contain 0
         return new FieldCacheDocIdSet(reader, !(inclusiveLowerPoint <= 0 && inclusiveUpperPoint >= 0)) {
+          @Override
           boolean matchDoc(int doc) {
             return values[doc] >= inclusiveLowerPoint && values[doc] <= inclusiveUpperPoint;
           }
@@ -291,6 +300,7 @@
    */
   public static FieldCacheRangeFilter<Long> newLongRange(String field, FieldCache.LongParser parser, Long lowerVal, Long upperVal, boolean includeLower, boolean includeUpper) {
     return new FieldCacheRangeFilter<Long>(field, parser, lowerVal, upperVal, includeLower, includeUpper) {
+      @Override
       public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
         final long inclusiveLowerPoint, inclusiveUpperPoint;
         if (lowerVal != null) {
@@ -316,6 +326,7 @@
         final long[] values = FieldCache.DEFAULT.getLongs(reader, field, (FieldCache.LongParser) parser);
         // ignore deleted docs if range doesn't contain 0
         return new FieldCacheDocIdSet(reader, !(inclusiveLowerPoint <= 0L && inclusiveUpperPoint >= 0L)) {
+          @Override
           boolean matchDoc(int doc) {
             return values[doc] >= inclusiveLowerPoint && values[doc] <= inclusiveUpperPoint;
           }
@@ -340,6 +351,7 @@
    */
   public static FieldCacheRangeFilter<Float> newFloatRange(String field, FieldCache.FloatParser parser, Float lowerVal, Float upperVal, boolean includeLower, boolean includeUpper) {
     return new FieldCacheRangeFilter<Float>(field, parser, lowerVal, upperVal, includeLower, includeUpper) {
+      @Override
       public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
         // we transform the floating point numbers to sortable integers
         // using NumericUtils to easier find the next bigger/lower value
@@ -369,6 +381,7 @@
         final float[] values = FieldCache.DEFAULT.getFloats(reader, field, (FieldCache.FloatParser) parser);
         // ignore deleted docs if range doesn't contain 0
         return new FieldCacheDocIdSet(reader, !(inclusiveLowerPoint <= 0.0f && inclusiveUpperPoint >= 0.0f)) {
+          @Override
           boolean matchDoc(int doc) {
             return values[doc] >= inclusiveLowerPoint && values[doc] <= inclusiveUpperPoint;
           }
@@ -393,6 +406,7 @@
    */
   public static FieldCacheRangeFilter<Double> newDoubleRange(String field, FieldCache.DoubleParser parser, Double lowerVal, Double upperVal, boolean includeLower, boolean includeUpper) {
     return new FieldCacheRangeFilter<Double>(field, parser, lowerVal, upperVal, includeLower, includeUpper) {
+      @Override
       public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
         // we transform the floating point numbers to sortable integers
         // using NumericUtils to easier find the next bigger/lower value
@@ -422,6 +436,7 @@
         final double[] values = FieldCache.DEFAULT.getDoubles(reader, field, (FieldCache.DoubleParser) parser);
         // ignore deleted docs if range doesn't contain 0
         return new FieldCacheDocIdSet(reader, !(inclusiveLowerPoint <= 0.0 && inclusiveUpperPoint >= 0.0)) {
+          @Override
           boolean matchDoc(int doc) {
             return values[doc] >= inclusiveLowerPoint && values[doc] <= inclusiveUpperPoint;
           }
@@ -430,6 +445,7 @@
     };
   }
   
+  @Override
   public final String toString() {
     final StringBuilder sb = new StringBuilder(field).append(":");
     return sb.append(includeLower ? '[' : '{')
@@ -440,6 +456,7 @@
       .toString();
   }
 
+  @Override
   public final boolean equals(Object o) {
     if (this == o) return true;
     if (!(o instanceof FieldCacheRangeFilter)) return false;
@@ -455,6 +472,7 @@
     return true;
   }
   
+  @Override
   public final int hashCode() {
     int h = field.hashCode();
     h ^= (lowerVal != null) ? lowerVal.hashCode() : 550356204;
@@ -526,11 +544,12 @@
       // incrementing a variable & checking skipDocs -
       return new DocIdSetIterator() {
         private int doc = -1;
-
+        @Override
         public int docID() {
           return doc;
         }
-
+        
+        @Override
         public int nextDoc() {
           try {
             do {
@@ -542,7 +561,8 @@
             return doc = NO_MORE_DOCS;
           }
         }
-
+        
+        @Override
         public int advance(int target) {
           try {
             doc = target;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCacheTermsFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCacheTermsFilter.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCacheTermsFilter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCacheTermsFilter.java Thu Oct 29 21:29:47 2009
@@ -106,6 +106,7 @@
     return FieldCache.DEFAULT;
   }
 
+  @Override
   public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
     return new FieldCacheTermsFilterDocIdSet(getFieldCache().getStringIndex(reader, field));
   }
@@ -138,10 +139,12 @@
     protected class FieldCacheTermsFilterDocIdSetIterator extends DocIdSetIterator {
       private int doc = -1;
 
+      @Override
       public int docID() {
         return doc;
       }
 
+      @Override
       public int nextDoc() {
         try {
           while (!openBitSet.fastGet(fcsi.order[++doc])) {}
@@ -151,6 +154,7 @@
         return doc;
       }
 
+      @Override
       public int advance(int target) {
         try {
           doc = target;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldComparator.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldComparator.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldComparator.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldComparator.java Thu Oct 29 21:29:47 2009
@@ -178,26 +178,32 @@
       this.parser = (ByteParser) parser;
     }
 
+    @Override
     public int compare(int slot1, int slot2) {
       return values[slot1] - values[slot2];
     }
 
+    @Override
     public int compareBottom(int doc) {
       return bottom - currentReaderValues[doc];
     }
 
+    @Override
     public void copy(int slot, int doc) {
       values[slot] = currentReaderValues[doc];
     }
 
+    @Override
     public void setNextReader(IndexReader reader, int docBase) throws IOException {
       currentReaderValues = FieldCache.DEFAULT.getBytes(reader, field, parser);
     }
     
+    @Override
     public void setBottom(final int bottom) {
       this.bottom = values[bottom];
     }
 
+    @Override
     public Comparable value(int slot) {
       return Byte.valueOf(values[slot]);
     }
@@ -213,20 +219,24 @@
       docIDs = new int[numHits];
     }
 
+    @Override
     public int compare(int slot1, int slot2) {
       // No overflow risk because docIDs are non-negative
       return docIDs[slot1] - docIDs[slot2];
     }
 
+    @Override
     public int compareBottom(int doc) {
       // No overflow risk because docIDs are non-negative
       return bottom - (docBase + doc);
     }
 
+    @Override
     public void copy(int slot, int doc) {
       docIDs[slot] = docBase + doc;
     }
 
+    @Override
     public void setNextReader(IndexReader reader, int docBase) {
       // TODO: can we "map" our docIDs to the current
       // reader? saves having to then subtract on every
@@ -234,10 +244,12 @@
       this.docBase = docBase;
     }
     
+    @Override
     public void setBottom(final int bottom) {
       this.bottom = docIDs[bottom];
     }
 
+    @Override
     public Comparable value(int slot) {
       return Integer.valueOf(docIDs[slot]);
     }
@@ -258,6 +270,7 @@
       this.parser = (DoubleParser) parser;
     }
 
+    @Override
     public int compare(int slot1, int slot2) {
       final double v1 = values[slot1];
       final double v2 = values[slot2];
@@ -270,6 +283,7 @@
       }
     }
 
+    @Override
     public int compareBottom(int doc) {
       final double v2 = currentReaderValues[doc];
       if (bottom > v2) {
@@ -281,18 +295,22 @@
       }
     }
 
+    @Override
     public void copy(int slot, int doc) {
       values[slot] = currentReaderValues[doc];
     }
 
+    @Override
     public void setNextReader(IndexReader reader, int docBase) throws IOException {
       currentReaderValues = FieldCache.DEFAULT.getDoubles(reader, field, parser);
     }
     
+    @Override
     public void setBottom(final int bottom) {
       this.bottom = values[bottom];
     }
 
+    @Override
     public Comparable value(int slot) {
       return Double.valueOf(values[slot]);
     }
@@ -313,6 +331,7 @@
       this.parser = (FloatParser) parser;
     }
 
+    @Override
     public int compare(int slot1, int slot2) {
       // TODO: are there sneaky non-branch ways to compute
       // sign of float?
@@ -327,6 +346,7 @@
       }
     }
 
+    @Override
     public int compareBottom(int doc) {
       // TODO: are there sneaky non-branch ways to compute
       // sign of float?
@@ -340,18 +360,22 @@
       }
     }
 
+    @Override
     public void copy(int slot, int doc) {
       values[slot] = currentReaderValues[doc];
     }
 
+    @Override
     public void setNextReader(IndexReader reader, int docBase) throws IOException {
       currentReaderValues = FieldCache.DEFAULT.getFloats(reader, field, parser);
     }
     
+    @Override
     public void setBottom(final int bottom) {
       this.bottom = values[bottom];
     }
 
+    @Override
     public Comparable value(int slot) {
       return Float.valueOf(values[slot]);
     }
@@ -372,6 +396,7 @@
       this.parser = (IntParser) parser;
     }
 
+    @Override
     public int compare(int slot1, int slot2) {
       // TODO: there are sneaky non-branch ways to compute
       // -1/+1/0 sign
@@ -388,6 +413,7 @@
       }
     }
 
+    @Override
     public int compareBottom(int doc) {
       // TODO: there are sneaky non-branch ways to compute
       // -1/+1/0 sign
@@ -403,18 +429,22 @@
       }
     }
 
+    @Override
     public void copy(int slot, int doc) {
       values[slot] = currentReaderValues[doc];
     }
 
+    @Override
     public void setNextReader(IndexReader reader, int docBase) throws IOException {
       currentReaderValues = FieldCache.DEFAULT.getInts(reader, field, parser);
     }
     
+    @Override
     public void setBottom(final int bottom) {
       this.bottom = values[bottom];
     }
 
+    @Override
     public Comparable value(int slot) {
       return Integer.valueOf(values[slot]);
     }
@@ -435,6 +465,7 @@
       this.parser = (LongParser) parser;
     }
 
+    @Override
     public int compare(int slot1, int slot2) {
       // TODO: there are sneaky non-branch ways to compute
       // -1/+1/0 sign
@@ -449,6 +480,7 @@
       }
     }
 
+    @Override
     public int compareBottom(int doc) {
       // TODO: there are sneaky non-branch ways to compute
       // -1/+1/0 sign
@@ -462,18 +494,22 @@
       }
     }
 
+    @Override
     public void copy(int slot, int doc) {
       values[slot] = currentReaderValues[doc];
     }
 
+    @Override
     public void setNextReader(IndexReader reader, int docBase) throws IOException {
       currentReaderValues = FieldCache.DEFAULT.getLongs(reader, field, parser);
     }
     
+    @Override
     public void setBottom(final int bottom) {
       this.bottom = values[bottom];
     }
 
+    @Override
     public Comparable value(int slot) {
       return Long.valueOf(values[slot]);
     }
@@ -494,34 +530,41 @@
       scores = new float[numHits];
     }
 
+    @Override
     public int compare(int slot1, int slot2) {
       final float score1 = scores[slot1];
       final float score2 = scores[slot2];
       return score1 > score2 ? -1 : (score1 < score2 ? 1 : 0);
     }
 
+    @Override
     public int compareBottom(int doc) throws IOException {
       float score = scorer.score();
       return bottom > score ? -1 : (bottom < score ? 1 : 0);
     }
 
+    @Override
     public void copy(int slot, int doc) throws IOException {
       scores[slot] = scorer.score();
     }
 
+    @Override
     public void setNextReader(IndexReader reader, int docBase) {
     }
     
+    @Override
     public void setBottom(final int bottom) {
       this.bottom = scores[bottom];
     }
 
+    @Override
     public void setScorer(Scorer scorer) {
       // wrap with a ScoreCachingWrappingScorer so that successive calls to
       // score() will not incur score computation over and over again.
       this.scorer = new ScoreCachingWrappingScorer(scorer);
     }
     
+    @Override
     public Comparable value(int slot) {
       return Float.valueOf(scores[slot]);
     }
@@ -542,26 +585,32 @@
       this.parser = (ShortParser) parser;
     }
 
+    @Override
     public int compare(int slot1, int slot2) {
       return values[slot1] - values[slot2];
     }
 
+    @Override
     public int compareBottom(int doc) {
       return bottom - currentReaderValues[doc];
     }
 
+    @Override
     public void copy(int slot, int doc) {
       values[slot] = currentReaderValues[doc];
     }
 
+    @Override
     public void setNextReader(IndexReader reader, int docBase) throws IOException {
       currentReaderValues = FieldCache.DEFAULT.getShorts(reader, field, parser);
     }
     
+    @Override
     public void setBottom(final int bottom) {
       this.bottom = values[bottom];
     }
 
+    @Override
     public Comparable value(int slot) {
       return Short.valueOf(values[slot]);
     }
@@ -583,6 +632,7 @@
       collator = Collator.getInstance(locale);
     }
 
+    @Override
     public int compare(int slot1, int slot2) {
       final String val1 = values[slot1];
       final String val2 = values[slot2];
@@ -597,6 +647,7 @@
       return collator.compare(val1, val2);
     }
 
+    @Override
     public int compareBottom(int doc) {
       final String val2 = currentReaderValues[doc];
       if (bottom == null) {
@@ -610,18 +661,22 @@
       return collator.compare(bottom, val2);
     }
 
+    @Override
     public void copy(int slot, int doc) {
       values[slot] = currentReaderValues[doc];
     }
 
+    @Override
     public void setNextReader(IndexReader reader, int docBase) throws IOException {
       currentReaderValues = FieldCache.DEFAULT.getStrings(reader, field);
     }
     
+    @Override
     public void setBottom(final int bottom) {
       this.bottom = values[bottom];
     }
 
+    @Override
     public Comparable value(int slot) {
       return values[slot];
     }
@@ -662,6 +717,7 @@
       this.field = field;
     }
 
+    @Override
     public int compare(int slot1, int slot2) {
       if (readerGen[slot1] == readerGen[slot2]) {
         int cmp = ords[slot1] - ords[slot2];
@@ -683,6 +739,7 @@
       return val1.compareTo(val2);
     }
 
+    @Override
     public int compareBottom(int doc) {
       assert bottomSlot != -1;
       int order = this.order[doc];
@@ -734,6 +791,7 @@
       ords[slot] = index;
     }
 
+    @Override
     public void copy(int slot, int doc) {
       final int ord = order[doc];
       ords[slot] = ord;
@@ -742,6 +800,7 @@
       readerGen[slot] = currentReaderGen;
     }
 
+    @Override
     public void setNextReader(IndexReader reader, int docBase) throws IOException {
       StringIndex currentReaderValues = FieldCache.DEFAULT.getStringIndex(reader, field);
       currentReaderGen++;
@@ -754,6 +813,7 @@
       }
     }
     
+    @Override
     public void setBottom(final int bottom) {
       bottomSlot = bottom;
       if (readerGen[bottom] != currentReaderGen) {
@@ -765,6 +825,7 @@
       bottomValue = values[bottom];
     }
 
+    @Override
     public Comparable value(int slot) {
       return values[slot];
     }
@@ -798,6 +859,7 @@
       this.field = field;
     }
 
+    @Override
     public int compare(int slot1, int slot2) {
       final String val1 = values[slot1];
       final String val2 = values[slot2];
@@ -813,6 +875,7 @@
       return val1.compareTo(val2);
     }
 
+    @Override
     public int compareBottom(int doc) {
       final String val2 = currentReaderValues[doc];
       if (bottom == null) {
@@ -826,18 +889,22 @@
       return bottom.compareTo(val2);
     }
 
+    @Override
     public void copy(int slot, int doc) {
       values[slot] = currentReaderValues[doc];
     }
 
+    @Override
     public void setNextReader(IndexReader reader, int docBase) throws IOException {
       currentReaderValues = FieldCache.DEFAULT.getStrings(reader, field);
     }
     
+    @Override
     public void setBottom(final int bottom) {
       this.bottom = values[bottom];
     }
 
+    @Override
     public Comparable value(int slot) {
       return values[slot];
     }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldDoc.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldDoc.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldDoc.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldDoc.java Thu Oct 29 21:29:47 2009
@@ -38,37 +38,38 @@
  */
 public class FieldDoc extends ScoreDoc {
 
-	/** Expert: The values which are used to sort the referenced document.
-	 * The order of these will match the original sort criteria given by a
-	 * Sort object.  Each Object will be either an Integer, Float or String,
-	 * depending on the type of values in the terms of the original field.
-	 * @see Sort
-	 * @see Searcher#search(Query,Filter,int,Sort)
-	 */
-	public Comparable[] fields;
+  /** Expert: The values which are used to sort the referenced document.
+   * The order of these will match the original sort criteria given by a
+   * Sort object.  Each Object will be either an Integer, Float or String,
+   * depending on the type of values in the terms of the original field.
+   * @see Sort
+   * @see Searcher#search(Query,Filter,int,Sort)
+   */
+  public Comparable[] fields;
 
-	/** Expert: Creates one of these objects with empty sort information. */
-	public FieldDoc (int doc, float score) {
-		super (doc, score);
-	}
+  /** Expert: Creates one of these objects with empty sort information. */
+  public FieldDoc (int doc, float score) {
+    super (doc, score);
+  }
 
-	/** Expert: Creates one of these objects with the given sort information. */
-	public FieldDoc (int doc, float score, Comparable[] fields) {
-		super (doc, score);
-		this.fields = fields;
-	}
-	
-	// A convenience method for debugging.
-	public String toString() {
-	  // super.toString returns the doc and score information, so just add the
+  /** Expert: Creates one of these objects with the given sort information. */
+  public FieldDoc (int doc, float score, Comparable[] fields) {
+    super (doc, score);
+    this.fields = fields;
+  }
+  
+  // A convenience method for debugging.
+  @Override
+  public String toString() {
+    // super.toString returns the doc and score information, so just add the
           // fields information
-	  StringBuilder sb = new StringBuilder(super.toString());
-	  sb.append("[");
-	  for (int i = 0; i < fields.length; i++) {
+    StringBuilder sb = new StringBuilder(super.toString());
+    sb.append("[");
+    for (int i = 0; i < fields.length; i++) {
             sb.append(fields[i]).append(", ");
           }
-	  sb.setLength(sb.length() - 2); // discard last ", "
-	  sb.append("]");
-	  return super.toString();
-	}
+    sb.setLength(sb.length() - 2); // discard last ", "
+    sb.append("]");
+    return super.toString();
+  }
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldValueHitQueue.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldValueHitQueue.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldValueHitQueue.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldValueHitQueue.java Thu Oct 29 21:29:47 2009
@@ -47,6 +47,7 @@
       this.score = score;
     }
     
+    @Override
     public String toString() {
       return "slot:" + slot + " docID:" + docID + " score=" + score;
     }
@@ -84,6 +85,7 @@
      * @param b ScoreDoc
      * @return <code>true</code> if document <code>a</code> should be sorted after document <code>b</code>.
      */
+    @Override
     protected boolean lessThan(final Entry hitA, final Entry hitB) {
 
       assert hitA != hitB;
@@ -121,6 +123,7 @@
       initialize(size);
     }
   
+    @Override
     protected boolean lessThan(final Entry hitA, final Entry hitB) {
 
       assert hitA != hitB;
@@ -190,6 +193,7 @@
   protected final FieldComparator[] comparators;
   protected final int[] reverseMul;
 
+  @Override
   protected abstract boolean lessThan (final Entry a, final Entry b);
 
   /**

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredDocIdSet.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredDocIdSet.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredDocIdSet.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredDocIdSet.java Thu Oct 29 21:29:47 2009
@@ -69,6 +69,7 @@
   // @Override
   public DocIdSetIterator iterator() throws IOException {
     return new FilteredDocIdSetIterator(_innerSet.iterator()) {
+      @Override
       protected boolean match(int docid) throws IOException {
         return FilteredDocIdSet.this.match(docid);
       }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredDocIdSetIterator.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredDocIdSetIterator.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredDocIdSetIterator.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredDocIdSetIterator.java Thu Oct 29 21:29:47 2009
@@ -49,10 +49,12 @@
    */
   abstract protected boolean match(int doc) throws IOException;
 	
+  @Override
   public int docID() {
     return doc;
   }
   
+  @Override
   public int nextDoc() throws IOException {
     while ((doc = _innerIter.nextDoc()) != NO_MORE_DOCS) {
       if (match(doc)) {
@@ -62,6 +64,7 @@
     return doc;
   }
   
+  @Override
   public int advance(int target) throws IOException {
     doc = _innerIter.advance(target);
     if (doc != NO_MORE_DOCS) {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredQuery.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredQuery.java Thu Oct 29 21:29:47 2009
@@ -58,6 +58,7 @@
    * Returns a Weight that applies the filter to the enclosed query's Weight.
    * This is accomplished by overriding the Scorer returned by the Weight.
    */
+  @Override
   public Weight createWeight(final Searcher searcher) throws IOException {
     final Weight weight = query.createWeight (searcher);
     final Similarity similarity = query.getSimilarity(searcher);
@@ -65,14 +66,21 @@
       private float value;
         
       // pass these methods through to enclosed query's weight
+      @Override
       public float getValue() { return value; }
+      
+      @Override
       public float sumOfSquaredWeights() throws IOException { 
         return weight.sumOfSquaredWeights() * getBoost() * getBoost(); 
       }
+
+      @Override
       public void normalize (float v) { 
         weight.normalize(v);
         value = weight.getValue() * getBoost();
       }
+
+      @Override
       public Explanation explain (IndexReader ir, int i) throws IOException {
         Explanation inner = weight.explain (ir, i);
         if (getBoost()!=1) {
@@ -98,9 +106,11 @@
       }
 
       // return this query
+      @Override
       public Query getQuery() { return FilteredQuery.this; }
 
       // return a filtering scorer
+      @Override
       public Scorer scorer(IndexReader indexReader, boolean scoreDocsInOrder, boolean topScorer)
           throws IOException {
         final Scorer scorer = weight.scorer(indexReader, true, false);
@@ -131,6 +141,7 @@
             return scorerDoc;
           }
 
+          @Override
           public int nextDoc() throws IOException {
             int scorerDoc, disiDoc;
             return doc = (disiDoc = docIdSetIterator.nextDoc()) != NO_MORE_DOCS
@@ -138,8 +149,10 @@
                 && advanceToCommon(scorerDoc, disiDoc) != NO_MORE_DOCS ? scorer.docID() : NO_MORE_DOCS;
           }
           
+          @Override
           public int docID() { return doc; }
           
+          @Override
           public int advance(int target) throws IOException {
             int disiDoc, scorerDoc;
             return doc = (disiDoc = docIdSetIterator.advance(target)) != NO_MORE_DOCS
@@ -147,27 +160,15 @@
                 && advanceToCommon(scorerDoc, disiDoc) != NO_MORE_DOCS ? scorer.docID() : NO_MORE_DOCS;
           }
 
+          @Override
           public float score() throws IOException { return getBoost() * scorer.score(); }
-
-          // add an explanation about whether the document was filtered
-          public Explanation explain (int i) throws IOException {
-            Explanation exp = scorer.explain(i);
-            
-            if (docIdSetIterator.advance(i) == i) {
-              exp.setDescription ("allowed by filter: "+exp.getDescription());
-              exp.setValue(getBoost() * exp.getValue());
-            } else {
-              exp.setDescription ("removed by filter: "+exp.getDescription());
-              exp.setValue(0.0f);
-            }
-            return exp;
-          }
         };
       }
     };
   }
 
   /** Rewrites the wrapped query. */
+  @Override
   public Query rewrite(IndexReader reader) throws IOException {
     Query rewritten = query.rewrite(reader);
     if (rewritten != query) {
@@ -188,11 +189,13 @@
   }
 
   // inherit javadoc
+  @Override
   public void extractTerms(Set<Term> terms) {
       getQuery().extractTerms(terms);
   }
 
   /** Prints a user-readable version of this query. */
+  @Override
   public String toString (String s) {
     StringBuilder buffer = new StringBuilder();
     buffer.append("filtered(");
@@ -204,6 +207,7 @@
   }
 
   /** Returns true iff <code>o</code> is equal to this. */
+  @Override
   public boolean equals(Object o) {
     if (o instanceof FilteredQuery) {
       FilteredQuery fq = (FilteredQuery) o;
@@ -213,6 +217,7 @@
   }
 
   /** Returns a hash code value for this object. */
+  @Override
   public int hashCode() {
     return query.hashCode() ^ filter.hashCode() + Float.floatToRawIntBits(getBoost());
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredTermEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredTermEnum.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredTermEnum.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FilteredTermEnum.java Thu Oct 29 21:29:47 2009
@@ -63,6 +63,7 @@
      * Returns the docFreq of the current Term in the enumeration.
      * Returns -1 if no Term matches or all terms have been enumerated.
      */
+    @Override
     public int docFreq() {
         if (currentTerm == null) return -1;
         assert actualEnum != null;
@@ -70,6 +71,7 @@
     }
     
     /** Increments the enumeration to the next element.  True if one exists. */
+    @Override
     public boolean next() throws IOException {
         if (actualEnum == null) return false; // the actual enumerator is not initialized!
         currentTerm = null;
@@ -90,11 +92,13 @@
     
     /** Returns the current Term in the enumeration.
      * Returns null if no Term matches or all terms have been enumerated. */
+    @Override
     public Term term() {
         return currentTerm;
     }
     
     /** Closes the enumeration to further activity, freeing resources.  */
+    @Override
     public void close() throws IOException {
         if (actualEnum != null) actualEnum.close();
         currentTerm = null;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FuzzyQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FuzzyQuery.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FuzzyQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FuzzyQuery.java Thu Oct 29 21:29:47 2009
@@ -110,10 +110,12 @@
   }
 
   // @deprecated see #getTermsEnum
+  @Override
   protected FilteredTermEnum getEnum(IndexReader reader) throws IOException {
     return new FuzzyTermEnum(reader, getTerm(), minimumSimilarity, prefixLength);
   }
   
+  @Override
   protected FilteredTermsEnum getTermsEnum(IndexReader reader) throws IOException {
     return new FuzzyTermsEnum(reader, getTerm(), minimumSimilarity, prefixLength);
   }
@@ -125,6 +127,7 @@
     return term;
   }
 
+  @Override
   public void setRewriteMethod(RewriteMethod method) {
     throw new UnsupportedOperationException("FuzzyQuery cannot change rewrite method");
   }
@@ -178,6 +181,7 @@
     return query;
   }
     
+  @Override
   public String toString(String field) {
     StringBuilder buffer = new StringBuilder();
     if (!term.field().equals(field)) {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FuzzyTermEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FuzzyTermEnum.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FuzzyTermEnum.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FuzzyTermEnum.java Thu Oct 29 21:29:47 2009
@@ -127,6 +127,7 @@
    * The termCompare method in FuzzyTermEnum uses Levenshtein distance to 
    * calculate the distance between the given term and the comparing term. 
    */
+  @Override
   protected final boolean termCompare(Term term) {
     if (field == term.field() && term.text().startsWith(prefix)) {
         final String target = term.text().substring(prefix.length());
@@ -138,11 +139,13 @@
   }
   
   /** {@inheritDoc} */
+  @Override
   public final float difference() {
     return (similarity - minimumSimilarity) * scale_factor;
   }
   
   /** {@inheritDoc} */
+  @Override
   public final boolean endEnum() {
     return endEnum;
   }
@@ -273,6 +276,7 @@
   }
 
   /** {@inheritDoc} */
+  @Override
   public void close() throws IOException {
     p = d = null;
     searchTerm = null;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/HitQueue.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/HitQueue.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/HitQueue.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/HitQueue.java Thu Oct 29 21:29:47 2009
@@ -68,6 +68,7 @@
   }
 
   // Returns null if prePopulate is false.
+  @Override
   protected ScoreDoc getSentinelObject() {
     // Always set the doc Id to MAX_VALUE so that it won't be favored by
     // lessThan. This generally should not happen since if score is not NEG_INF,
@@ -75,6 +76,7 @@
     return !prePopulate ? null : new ScoreDoc(Integer.MAX_VALUE, Float.NEGATIVE_INFINITY);
   }
   
+  @Override
   protected final boolean lessThan(ScoreDoc hitA, ScoreDoc hitB) {
     if (hitA.score == hitB.score)
       return hitA.doc > hitB.doc; 

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/IndexSearcher.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/IndexSearcher.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/IndexSearcher.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/IndexSearcher.java Thu Oct 29 21:29:47 2009
@@ -116,17 +116,20 @@
    * If the IndexReader was supplied implicitly by specifying a directory, then
    * the IndexReader gets closed.
    */
+  @Override
   public void close() throws IOException {
     if(closeReader)
       reader.close();
   }
 
   // inherit javadoc
+  @Override
   public int docFreq(Term term) throws IOException {
     return reader.docFreq(term);
   }
 
   // inherit javadoc
+  @Override
   public Document doc(int i) throws CorruptIndexException, IOException {
     return reader.document(i);
   }
@@ -137,11 +140,13 @@
   }
   
   // inherit javadoc
+  @Override
   public int maxDoc() throws IOException {
     return reader.maxDoc();
   }
 
   // inherit javadoc
+  @Override
   public TopDocs search(Weight weight, Filter filter, final int nDocs) throws IOException {
 
     if (nDocs <= 0) {
@@ -153,6 +158,7 @@
     return collector.topDocs();
   }
 
+  @Override
   public TopFieldDocs search(Weight weight, Filter filter,
       final int nDocs, Sort sort) throws IOException {
     return search(weight, filter, nDocs, sort, true);
@@ -185,6 +191,7 @@
     return (TopFieldDocs) collector.topDocs();
   }
 
+  @Override
   public void search(Weight weight, Filter filter, Collector collector)
       throws IOException {
     
@@ -250,6 +257,7 @@
     }
   }
 
+  @Override
   public Query rewrite(Query original) throws IOException {
     Query query = original;
     for (Query rewrittenQuery = query.rewrite(reader); rewrittenQuery != query;
@@ -259,6 +267,7 @@
     return query;
   }
 
+  @Override
   public Explanation explain(Weight weight, int doc) throws IOException {
     int n = ReaderUtil.subIndex(doc, docStarts);
     int deBasedDoc = doc - docStarts[n];
@@ -269,7 +278,18 @@
   private boolean fieldSortDoTrackScores;
   private boolean fieldSortDoMaxScore;
 
-  /** @deprecated */
+  /** By default, no scores are computed when sorting by
+   *  field (using {@link #search(Query,Filter,int,Sort)}).
+   *  You can change that, per IndexSearcher instance, by
+   *  calling this method.  Note that this will incur a CPU
+   *  cost.
+   * 
+   *  @param doTrackScores If true, then scores are
+   *  returned for every matching document in {@link
+   *  TopFieldDocs}.
+   *
+   *  @param doMaxScore If true, then the max score for all
+   *  matching docs is computed. */
   public void setDefaultFieldSortScoring(boolean doTrackScores, boolean doMaxScore) {
     fieldSortDoTrackScores = doTrackScores;
     fieldSortDoMaxScore = doMaxScore;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MatchAllDocsQuery.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MatchAllDocsQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MatchAllDocsQuery.java Thu Oct 29 21:29:47 2009
@@ -60,14 +60,12 @@
       this.norms = norms;
     }
 
-    public Explanation explain(int doc) {
-      return null; // not called... see MatchAllDocsWeight.explain()
-    }
-
+    @Override
     public int docID() {
       return doc;
     }
 
+    @Override
     public int nextDoc() throws IOException {
       doc++;
       while(delDocs != null && doc < maxDoc && delDocs.get(doc)) {
@@ -79,10 +77,12 @@
       return doc;
     }
     
+    @Override
     public float score() {
       return norms == null ? score : score * Similarity.decodeNorm(norms[docID()]);
     }
 
+    @Override
     public int advance(int target) throws IOException {
       doc = target-1;
       return nextDoc();
@@ -98,33 +98,40 @@
       this.similarity = searcher.getSimilarity();
     }
 
+    @Override
     public String toString() {
       return "weight(" + MatchAllDocsQuery.this + ")";
     }
 
+    @Override
     public Query getQuery() {
       return MatchAllDocsQuery.this;
     }
 
+    @Override
     public float getValue() {
       return queryWeight;
     }
 
+    @Override
     public float sumOfSquaredWeights() {
       queryWeight = getBoost();
       return queryWeight * queryWeight;
     }
 
+    @Override
     public void normalize(float queryNorm) {
       this.queryNorm = queryNorm;
       queryWeight *= this.queryNorm;
     }
 
+    @Override
     public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException {
       return new MatchAllScorer(reader, similarity, this,
           normsField != null ? reader.norms(normsField) : null);
     }
 
+    @Override
     public Explanation explain(IndexReader reader, int doc) {
       // explain query weight
       Explanation queryExpl = new ComplexExplanation
@@ -138,13 +145,16 @@
     }
   }
 
+  @Override
   public Weight createWeight(Searcher searcher) {
     return new MatchAllDocsWeight(searcher);
   }
 
+  @Override
   public void extractTerms(Set<Term> terms) {
   }
 
+  @Override
   public String toString(String field) {
     StringBuilder buffer = new StringBuilder();
     buffer.append("*:*");
@@ -152,6 +162,7 @@
     return buffer.toString();
   }
 
+  @Override
   public boolean equals(Object o) {
     if (!(o instanceof MatchAllDocsQuery))
       return false;
@@ -159,6 +170,7 @@
     return this.getBoost() == other.getBoost();
   }
 
+  @Override
   public int hashCode() {
     return Float.floatToIntBits(getBoost()) ^ 0x1AA71190;
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiPhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiPhraseQuery.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiPhraseQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiPhraseQuery.java Thu Oct 29 21:29:47 2009
@@ -116,6 +116,7 @@
   }
 
   // inherit javadoc
+  @Override
   public void extractTerms(Set terms) {
     for (final Term[] arr : termArrays) {
       for (final Term term: arr) {
@@ -145,20 +146,26 @@
       }
     }
 
+    @Override
     public Query getQuery() { return MultiPhraseQuery.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 (termArrays.size() == 0)                  // optimize zero-term case
         return null;
@@ -191,6 +198,7 @@
                                       slop, reader.norms(field));
     }
 
+    @Override
     public Explanation explain(IndexReader reader, int doc)
       throws IOException {
       ComplexExplanation result = new ComplexExplanation();
@@ -222,12 +230,16 @@
       fieldExpl.setDescription("fieldWeight("+getQuery()+" 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();
@@ -238,8 +250,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() *
                          idfExpl.getValue() *
                          fieldNormExpl.getValue());
 
@@ -256,6 +268,7 @@
     }
   }
 
+  @Override
   public Query rewrite(IndexReader reader) {
     if (termArrays.size() == 1) {                 // optimize one-term case
       Term[] terms = termArrays.get(0);
@@ -270,11 +283,13 @@
     }
   }
 
+  @Override
   public Weight createWeight(Searcher searcher) throws IOException {
     return new MultiPhraseWeight(searcher);
   }
 
   /** Prints a user-readable version of this query. */
+  @Override
   public final String toString(String f) {
     StringBuilder buffer = new StringBuilder();
     if (!field.equals(f)) {
@@ -314,6 +329,7 @@
 
 
   /** Returns true if <code>o</code> is equal to this. */
+  @Override
   public boolean equals(Object o) {
     if (!(o instanceof MultiPhraseQuery)) return false;
     MultiPhraseQuery other = (MultiPhraseQuery)o;
@@ -324,6 +340,7 @@
   }
 
   /** Returns a hash code value for this object.*/
+  @Override
   public int hashCode() {
     return Float.floatToIntBits(getBoost())
       ^ slop
@@ -337,25 +354,11 @@
     int hashCode = 1;
     for (final Term[] termArray: termArrays) {
       hashCode = 31 * hashCode
-          + (termArray == null ? 0 : arraysHashCode(termArray));
+          + (termArray == null ? 0 : Arrays.hashCode(termArray));
     }
     return hashCode;
   }
 
-  private int arraysHashCode(Term[] termArray) {
-      if (termArray == null)
-          return 0;
-
-      int result = 1;
-
-      for (int i = 0; i < termArray.length; i++) {
-        Term term = termArray[i];
-        result = 31 * result + (term == null ? 0 : term.hashCode());
-      }
-
-      return result;
-  }
-
   // Breakout calculation of the termArrays equals
   private boolean termArraysEquals(List<Term[]> termArrays1, List<Term[]> termArrays2) {
     if (termArrays1.size() != termArrays2.size()) {



Mime
View raw message