gate.creole.annic.apache.lucene.search
Class BooleanScorer

java.lang.Object
  extended by gate.creole.annic.apache.lucene.search.Scorer
      extended by gate.creole.annic.apache.lucene.search.BooleanScorer

final class BooleanScorer
extends Scorer


Nested Class Summary
(package private) static class BooleanScorer.Bucket
           
(package private) static class BooleanScorer.BucketTable
          A simple hash table of document scores within a range.
(package private) static class BooleanScorer.Collector
           
(package private) static class BooleanScorer.SubScorer
           
 
Field Summary
private  BooleanScorer.BucketTable bucketTable
           
private  float[] coordFactors
           
private  BooleanScorer.Bucket current
           
private  int end
           
private  int maxCoord
           
private  int nextMask
           
private  int prohibitedMask
           
private  int requiredMask
           
private  BooleanScorer.SubScorer scorers
           
 
Fields inherited from class gate.creole.annic.apache.lucene.search.Scorer
searcher
 
Constructor Summary
BooleanScorer(Similarity similarity)
           
 
Method Summary
(package private)  void add(Scorer scorer, boolean required, boolean prohibited)
           
private  void computeCoordFactors()
           
 int doc()
          Returns the current document number.
 Explanation explain(int doc)
          Returns an explanation of the score for doc.
 boolean next(Searcher searcher)
          Advance to the next document matching the query.
 float score(Searcher searcher)
          Returns the score of the current document.
 boolean skipTo(int target)
          Skips to the first match beyond the current whose document number is greater than or equal to target.
 String toString()
           
 
Methods inherited from class gate.creole.annic.apache.lucene.search.Scorer
getSimilarity, score
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

scorers

private BooleanScorer.SubScorer scorers

bucketTable

private BooleanScorer.BucketTable bucketTable

maxCoord

private int maxCoord

coordFactors

private float[] coordFactors

requiredMask

private int requiredMask

prohibitedMask

private int prohibitedMask

nextMask

private int nextMask

end

private int end

current

private BooleanScorer.Bucket current
Constructor Detail

BooleanScorer

BooleanScorer(Similarity similarity)
Method Detail

add

final void add(Scorer scorer,
               boolean required,
               boolean prohibited)
        throws IOException
Throws:
IOException

computeCoordFactors

private final void computeCoordFactors()
                                throws IOException
Throws:
IOException

doc

public int doc()
Description copied from class: Scorer
Returns the current document number. Initially invalid, until #next() is called the first time.

Specified by:
doc in class Scorer

next

public boolean next(Searcher searcher)
             throws IOException
Description copied from class: Scorer
Advance to the next document matching the query. Returns true iff there is another match.

Specified by:
next in class Scorer
Throws:
IOException

score

public float score(Searcher searcher)
            throws IOException
Description copied from class: Scorer
Returns the score of the current document. Initially invalid, until #next() is called the first time.

Specified by:
score in class Scorer
Throws:
IOException

skipTo

public boolean skipTo(int target)
               throws IOException
Description copied from class: Scorer
Skips to the first match beyond the current whose document number is greater than or equal to target.

Returns true iff there is such a match.

Behaves as if written:

   boolean skipTo(int target) {
     do {
       if (!next())
             return false;
     } while (target > doc());
     return true;
   }
 
Most implementations are considerably more efficient than that.

Specified by:
skipTo in class Scorer
Throws:
IOException

explain

public Explanation explain(int doc)
                    throws IOException
Description copied from class: Scorer
Returns an explanation of the score for doc.

Specified by:
explain in class Scorer
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object