org.apache.solr.analytics.statistics

## Class UniqueStatsCollector

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

- All Implemented Interfaces:
    StatsCollector

      public class UniqueStatsCollector
      extends AbstractDelegatingStatsCollector

  `UniqueValueCounter` computes the number of unique values.

- - ### Field Summary

    - ### Fields inherited from class org.apache.solr.analytics.statistics.AbstractDelegatingStatsCollector

      `delegate, statsList`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UniqueStatsCollector(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.
    `void` | `compute()` After all documents have been collected, this method should be called to finalize the calculations of each statistic.
    `Comparable` | `getStat(String stat)` Return the value of the given statistic.

    - ### Methods inherited from class org.apache.solr.analytics.statistics.AbstractDelegatingStatsCollector

      `delegate, getFunction, getStatsList, getValue, setNextReader, valueSourceString`

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

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

- - ### Constructor Detail

    - #### UniqueStatsCollector

          public UniqueStatsCollector(StatsCollector delegate)

  - ### Method Detail

    - #### 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`
      Overrides:
        `collect` in class `AbstractDelegatingStatsCollector`
      Parameters:
        `doc` - Document to collect from

    - #### getStat

          public Comparable getStat(String stat)

      Description copied from interface: `StatsCollector`
      Return the value of the given statistic.
      Parameters:
        `stat` - the stat
      Returns:
        a comparable

    - #### compute

          public void compute()

      Description copied from interface: `StatsCollector`
      After all documents have been collected, this method should be called to finalize the calculations of each statistic.

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