org.apache.solr.analytics.statistics

## Class PercentileStatsCollector

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

- All Implemented Interfaces:
    StatsCollector

      public class PercentileStatsCollector
      extends AbstractDelegatingStatsCollector

  `PercentileStatsCollector` computes a given list of percentiles.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Pattern` | `PERCENTILE_PATTERN`
    `protected String[]` | `percentileNames`
    `protected double[]` | `percentiles`
    `protected Comparable[]` | `results`
    `List<Comparable>` | `values`

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

      `delegate, statsList`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PercentileStatsCollector(StatsCollector delegate, double[] percentiles, String[] percentileNames)`

  - ### 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.
    `protected List<Comparable>` | `getPercentiles()`
    `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`

- - ### Field Detail

    - #### values

          public final List<Comparable> values

    - #### PERCENTILE_PATTERN

          public static final Pattern PERCENTILE_PATTERN

    - #### percentiles

          protected final double[] percentiles

    - #### percentileNames

          protected final String[] percentileNames

    - #### results

          protected Comparable[] results

  - ### Constructor Detail

    - #### PercentileStatsCollector

          public PercentileStatsCollector(StatsCollector delegate,
                                          double[] percentiles,
                                          String[] percentileNames)

  - ### Method Detail

    - #### 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.

    - #### getPercentiles

          protected List<Comparable> getPercentiles()

    - #### 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

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