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

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

final class ConjunctionScorer
extends Scorer

Scorer for conjunctions, sets of queries, all of which are required.


Field Summary
private  float coord
           
private  boolean firstTime
           
private  boolean more
           
private  LinkedList scorers
           
 
Fields inherited from class gate.creole.annic.apache.lucene.search.Scorer
searcher
 
Constructor Summary
ConjunctionScorer(Similarity similarity)
           
 
Method Summary
(package private)  void add(Scorer scorer)
           
 int doc()
          Returns the current document number.
private  boolean doNext()
           
 Explanation explain(int doc)
          Returns an explanation of the score for doc.
private  Scorer first()
           
private  void init()
           
private  Scorer last()
           
 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.
private  void sortScorers()
           
 
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, toString, wait, wait, wait
 

Field Detail

scorers

private LinkedList scorers

firstTime

private boolean firstTime

more

private boolean more

coord

private float coord
Constructor Detail

ConjunctionScorer

public ConjunctionScorer(Similarity similarity)
Method Detail

add

final void add(Scorer scorer)
        throws IOException
Throws:
IOException

first

private Scorer first()

last

private Scorer last()

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

doNext

private boolean doNext()
                throws IOException
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

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

init

private void init()
           throws IOException
Throws:
IOException

sortScorers

private void sortScorers()
                  throws IOException
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