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

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

final class TermScorer
extends Scorer


Field Summary
private  int doc
           
private  int[] docs
           
private  int[] freqs
           
private  byte[] norms
           
private  int pointer
           
private  int pointerMax
           
private static int SCORE_CACHE_SIZE
           
private  float[] scoreCache
           
private  Term term
           
private  TermDocs termDocs
           
private  Weight weight
           
private  float weightValue
           
 
Fields inherited from class gate.creole.annic.apache.lucene.search.Scorer
searcher
 
Constructor Summary
TermScorer(Weight weight, TermDocs td, Similarity similarity, byte[] norms, Term term)
           
 
Method Summary
 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

weight

private Weight weight

termDocs

private TermDocs termDocs

norms

private byte[] norms

weightValue

private float weightValue

doc

private int doc

term

private Term term

docs

private final int[] docs

freqs

private final int[] freqs

pointer

private int pointer

pointerMax

private int pointerMax

SCORE_CACHE_SIZE

private static final int SCORE_CACHE_SIZE
See Also:
Constant Field Values

scoreCache

private float[] scoreCache
Constructor Detail

TermScorer

TermScorer(Weight weight,
           TermDocs td,
           Similarity similarity,
           byte[] norms,
           Term term)
     throws IOException
Throws:
IOException
Method Detail

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