org.modeshape.jcr.query.lucene.basic

## Class ExistsTupleCollector

- java.lang.Object
- - org.apache.lucene.search.Collector
  - - org.modeshape.jcr.query.lucene.LuceneQueryEngine.TupleCollector
    - - org.modeshape.jcr.query.lucene.basic.ExistsTupleCollector

-     public class ExistsTupleCollector
      extends LuceneQueryEngine.TupleCollector

  A special TupleCollector implementation that will terminate when it comes across a second document with a non-zero score.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ExistsTupleCollector.CompletedException` Thrown when elapsed search time exceeds allowed search time.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExistsTupleCollector(LuceneQueryEngine.TupleCollector collector)` Create a ExistsTupleCollector wrapper over another `Collector`, where the wrapper stops after the first non-zero scored document.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `acceptsDocsOutOfOrder()`
    `float` | `doCollect(int doc)`
    `List<Object[]>` | `getTuples()` Get the tuples.
    `void` | `setNextReader(org.apache.lucene.index.IndexReader reader, int docBase)`
    `void` | `setScorer(org.apache.lucene.search.Scorer scorer)`

    - ### Methods inherited from class org.modeshape.jcr.query.lucene.LuceneQueryEngine.TupleCollector

      `collect`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ExistsTupleCollector

          public ExistsTupleCollector(LuceneQueryEngine.TupleCollector collector)

      Create a ExistsTupleCollector wrapper over another `Collector`, where the wrapper stops after the first non-zero scored document.
      Parameters:
        `collector` - the wrapped `Collector`

  - ### Method Detail

    - #### doCollect

          public float doCollect(int doc)
                          throws IOException

      Specified by:
        `doCollect` in class `LuceneQueryEngine.TupleCollector`
      Throws:
        `IOException`

    - #### getTuples

          public List<Object[]> getTuples()

      Description copied from class: `LuceneQueryEngine.TupleCollector`
      Get the tuples.
      Specified by:
        `getTuples` in class `LuceneQueryEngine.TupleCollector`
      Returns:
        the tuples; never null

    - #### setScorer

          public void setScorer(org.apache.lucene.search.Scorer scorer)
                         throws IOException

      Specified by:
        `setScorer` in class `org.apache.lucene.search.Collector`
      Throws:
        `IOException`

    - #### setNextReader

          public void setNextReader(org.apache.lucene.index.IndexReader reader,
                           int docBase)
                             throws IOException

      Specified by:
        `setNextReader` in class `org.apache.lucene.search.Collector`
      Throws:
        `IOException`

    - #### acceptsDocsOutOfOrder

          public boolean acceptsDocsOutOfOrder()

      Specified by:
        `acceptsDocsOutOfOrder` in class `org.apache.lucene.search.Collector`

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.