org.apache.solr.analytics.statistics

## Class AbstractDelegatingStatsCollector

- java.lang.Object
- - org.apache.solr.analytics.statistics.AbstractDelegatingStatsCollector

- All Implemented Interfaces:
    StatsCollector
  Direct Known Subclasses:
    MedianStatsCollector, PercentileStatsCollector, UniqueStatsCollector

      public abstract class AbstractDelegatingStatsCollector
      extends Object
      implements StatsCollector

  `AbstractDelegationStatsCollector` objects wrap other StatsCollectors. While they compute their own statistics they pass along all inputs and requests to the delegates as well.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected StatsCollector` | `delegate`
    `protected Set<String>` | `statsList`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractDelegatingStatsCollector(StatsCollector delegate)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `collect(int doc)` Collect values from the value source and add to statistics.
    `StatsCollector` | `delegate()`
    `FunctionValues` | `getFunction()`
    `Set<String>` | `getStatsList()`
    `MutableValue` | `getValue()`
    `void` | `setNextReader(LeafReaderContext context)`
    `String` | `valueSourceString()`

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

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

    - ### Methods inherited from interface org.apache.solr.analytics.statistics.StatsCollector

      `compute, getStat`

- - ### Field Detail

    - #### delegate

          protected final StatsCollector delegate

    - #### statsList

          protected final Set<String> statsList

  - ### Constructor Detail

    - #### AbstractDelegatingStatsCollector

          public AbstractDelegatingStatsCollector(StatsCollector delegate)

      Parameters:
        `delegate` - The delegate computing statistics on the same set of values.

  - ### Method Detail

    - #### setNextReader

          public void setNextReader(LeafReaderContext context)
                             throws IOException

      Specified by:
        `setNextReader` in interface `StatsCollector`
      Parameters:
        `context` - The context to read documents from.
      Throws:
        `IOException` - if setting next reader fails

    - #### delegate

          public StatsCollector delegate()

    - #### getStatsList

          public Set<String> getStatsList()

      Specified by:
        `getStatsList` in interface `StatsCollector`
      Returns:
        The set of statistics being computed by the stats collector.

    - #### getValue

          public MutableValue getValue()

      Specified by:
        `getValue` in interface `StatsCollector`

    - #### getFunction

          public FunctionValues getFunction()

      Specified by:
        `getFunction` in interface `StatsCollector`

    - #### collect

          public void collect(int doc)

      Description copied from interface: `StatsCollector`
      Collect values from the value source and add to statistics.
      Specified by:
        `collect` in interface `StatsCollector`
      Parameters:
        `doc` - Document to collect from

    - #### valueSourceString

          public String valueSourceString()

      Specified by:
        `valueSourceString` in interface `StatsCollector`
      Returns:
        The string representation of the value source.

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