org.apache.lucene.search.spans
Class SpanScorer

java.lang.Object
  extended by org.apache.lucene.search.DocIdSetIterator
      extended by org.apache.lucene.search.Scorer
          extended by org.apache.lucene.search.spans.SpanScorer
Direct Known Subclasses:
BoostingTermQuery.BoostingTermWeight.BoostingSpanScorer

public class SpanScorer
extends Scorer

Public for extension only.


Field Summary
protected  int doc
           
protected  boolean firstTime
           
protected  float freq
           
protected  boolean more
           
protected  byte[] norms
           
protected  Spans spans
           
protected  float value
           
protected  Weight weight
           
 
Constructor Summary
protected SpanScorer(Spans spans, Weight weight, Similarity similarity, byte[] norms)
           
 
Method Summary
 int doc()
          Returns the current document number.
 Explanation explain(int doc)
          Returns an explanation of the score for a document.
 boolean next()
          Moves to the next docId in the set.
 float score()
          Returns the score of the current document matching the query.
protected  boolean setFreqCurrentDoc()
           
 boolean skipTo(int target)
          Skips entries to the first beyond the current whose document number is greater than or equal to target.
 
Methods inherited from class org.apache.lucene.search.Scorer
getSimilarity, score, score
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

spans

protected Spans spans

weight

protected Weight weight

norms

protected byte[] norms

value

protected float value

firstTime

protected boolean firstTime

more

protected boolean more

doc

protected int doc

freq

protected float freq
Constructor Detail

SpanScorer

protected SpanScorer(Spans spans,
                     Weight weight,
                     Similarity similarity,
                     byte[] norms)
              throws IOException
Throws:
IOException
Method Detail

next

public boolean next()
             throws IOException
Description copied from class: DocIdSetIterator
Moves to the next docId in the set. Returns true, iff there is such a docId.

Specified by:
next in class DocIdSetIterator
Throws:
IOException

skipTo

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

Returns true iff there is such an entry.

Behaves as if written:

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

Specified by:
skipTo in class DocIdSetIterator
Throws:
IOException

setFreqCurrentDoc

protected boolean setFreqCurrentDoc()
                             throws IOException
Throws:
IOException

doc

public int doc()
Description copied from class: DocIdSetIterator
Returns the current document number.

This is invalid until DocIdSetIterator.next() is called for the first time.

Specified by:
doc in class DocIdSetIterator

score

public float score()
            throws IOException
Description copied from class: Scorer
Returns the score of the current document matching the query. Initially invalid, until DocIdSetIterator.next() or DocIdSetIterator.skipTo(int) is called the first time.

Specified by:
score 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 a document.
When this method is used, the DocIdSetIterator.next(), DocIdSetIterator.skipTo(int) and Scorer.score(HitCollector) methods should not be used.

Specified by:
explain in class Scorer
Parameters:
doc - The document number for the explanation.
Throws:
IOException


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.