net.sf.lucis.core.support
Class CountingCollector

java.lang.Object
  extended by org.apache.lucene.search.Collector
      extended by net.sf.lucis.core.support.CountingCollector
Direct Known Subclasses:
AllCollector

public class CountingCollector
extends Collector

A hit collector that simply counts the number of hits.

Author:
Andres Rodriguez

Constructor Summary
CountingCollector()
          Constructor.
 
Method Summary
 boolean acceptsDocsOutOfOrder()
           
 void collect(int doc)
           
 int getCount()
          Returns the document count.
 float getMaxScore()
          Returns the maximum collected score.
 void reset()
          Resets the collector.
 void setNextReader(IndexReader reader, int docBase)
           
 void setScorer(Scorer scorer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CountingCollector

public CountingCollector()
Constructor.

Method Detail

collect

public void collect(int doc)
             throws IOException
Specified by:
collect in class Collector
Throws:
IOException

acceptsDocsOutOfOrder

public boolean acceptsDocsOutOfOrder()
Specified by:
acceptsDocsOutOfOrder in class Collector

setNextReader

public void setNextReader(IndexReader reader,
                          int docBase)
                   throws IOException
Specified by:
setNextReader in class Collector
Throws:
IOException

setScorer

public void setScorer(Scorer scorer)
               throws IOException
Specified by:
setScorer in class Collector
Throws:
IOException

reset

public void reset()
Resets the collector.


getCount

public final int getCount()
Returns the document count.

Returns:
The document count

getMaxScore

public final float getMaxScore()
Returns the maximum collected score.

Returns:
The maximum collected score.


Copyright © 2013. All Rights Reserved.