org.apache.solr.analytics.statistics

## Interface StatsCollector

- All Known Implementing Classes:
    AbstractDelegatingStatsCollector, MedianStatsCollector, MinMaxStatsCollector, NumericStatsCollector, PercentileStatsCollector, UniqueStatsCollector

      public interface StatsCollector

  `StatsCollector` implementations reduce a list of Objects to a single value. Most implementations reduce a list to a statistic on that list.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `collect(int doc)` Collect values from the value source and add to statistics.
    `void` | `compute()` After all documents have been collected, this method should be called to finalize the calculations of each statistic.
    `FunctionValues` | `getFunction()`
    `Comparable` | `getStat(String stat)` Return the value of the given statistic.
    `Set<String>` | `getStatsList()`
    `MutableValue` | `getValue()`
    `void` | `setNextReader(LeafReaderContext context)`
    `String` | `valueSourceString()`

- - ### Method Detail

    - #### collect

          void collect(int doc)

      Collect values from the value source and add to statistics.
      Parameters:
        `doc` - Document to collect from

    - #### setNextReader

          void setNextReader(LeafReaderContext context)
                      throws IOException

      Parameters:
        `context` - The context to read documents from.
      Throws:
        `IOException` - if setting next reader fails

    - #### getValue

          MutableValue getValue()

    - #### getFunction

          FunctionValues getFunction()

    - #### getStatsList

          Set<String> getStatsList()

      Returns:
        The set of statistics being computed by the stats collector.

    - #### getStat

          Comparable getStat(String stat)

      Return the value of the given statistic.
      Parameters:
        `stat` - the stat
      Returns:
        a comparable

    - #### compute

          void compute()

      After all documents have been collected, this method should be called to finalize the calculations of each statistic.

    - #### valueSourceString

          String valueSourceString()

      Returns:
        The string representation of the value source.

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