org.apache.solr.search

## Class DelegatingCollector

- java.lang.Object
- - org.apache.lucene.search.SimpleCollector
  - - org.apache.solr.search.DelegatingCollector

- All Implemented Interfaces:
    Collector, LeafCollector

      public class DelegatingCollector
      extends SimpleCollector

  A simple delegating collector where one can set the delegate after creation

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected LeafReaderContext` | `context`
    `protected Collector` | `delegate`
    `protected int` | `docBase`
    `protected LeafCollector` | `leafDelegate`
    `protected Scorer` | `scorer`
    `static int` | `setLastDelegateCount`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DelegatingCollector()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `collect(int doc)`
    `protected void` | `doSetNextReader(LeafReaderContext context)`
    `void` | `finish()`
    `Collector` | `getDelegate()`
    `boolean` | `needsScores()`
    `void` | `setDelegate(Collector delegate)`
    `void` | `setLastDelegate(Collector delegate)` Sets the last delegate in a chain of DelegatingCollectors
    `void` | `setScorer(Scorer scorer)`

    - ### Methods inherited from class org.apache.lucene.search.SimpleCollector

      `getLeafCollector`

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

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

- - ### Field Detail

    - #### setLastDelegateCount

          public static int setLastDelegateCount

    - #### delegate

          protected Collector delegate

    - #### leafDelegate

          protected LeafCollector leafDelegate

    - #### scorer

          protected Scorer scorer

    - #### context

          protected LeafReaderContext context

    - #### docBase

          protected int docBase

  - ### Constructor Detail

    - #### DelegatingCollector

          public DelegatingCollector()

  - ### Method Detail

    - #### getDelegate

          public Collector getDelegate()

    - #### setDelegate

          public void setDelegate(Collector delegate)

    - #### setLastDelegate

          public void setLastDelegate(Collector delegate)

      Sets the last delegate in a chain of DelegatingCollectors

    - #### setScorer

          public void setScorer(Scorer scorer)
                         throws IOException

      Specified by:
        `setScorer` in interface `LeafCollector`
      Overrides:
        `setScorer` in class `SimpleCollector`
      Throws:
        `IOException`

    - #### needsScores

          public boolean needsScores()

    - #### collect

          public void collect(int doc)
                       throws IOException

      Specified by:
        `collect` in interface `LeafCollector`
      Specified by:
        `collect` in class `SimpleCollector`
      Throws:
        `IOException`

    - #### doSetNextReader

          protected void doSetNextReader(LeafReaderContext context)
                                  throws IOException

      Overrides:
        `doSetNextReader` in class `SimpleCollector`
      Throws:
        `IOException`

    - #### finish

          public void finish()
                      throws IOException

      Throws:
        `IOException`

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