org.apache.lucene.search

## Class DocValuesStats.SortedNumericDocValuesStats<T extends Number>

- java.lang.Object
- - org.apache.lucene.search.DocValuesStats<T>
  - - org.apache.lucene.search.DocValuesStats.SortedNumericDocValuesStats<T>

- Direct Known Subclasses:
    DocValuesStats.SortedDoubleDocValuesStats, DocValuesStats.SortedLongDocValuesStats
  Enclosing class:
    DocValuesStats<T>

      public abstract static class DocValuesStats.SortedNumericDocValuesStats<T extends Number>
      extends DocValuesStats<T>

  Holds statistics for a sorted-numeric DocValues field.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.lucene.search.DocValuesStats

      `DocValuesStats.DoubleDocValuesStats, DocValuesStats.LongDocValuesStats, DocValuesStats.NumericDocValuesStats<T extends Number>, DocValuesStats.SortedDocValuesStats, DocValuesStats.SortedDoubleDocValuesStats, DocValuesStats.SortedLongDocValuesStats, DocValuesStats.SortedNumericDocValuesStats<T extends Number>, DocValuesStats.SortedSetDocValuesStats`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected double` | `mean`
    `protected SortedNumericDocValues` | `sndv`
    `protected long` | `valuesCount`
    `protected double` | `variance`

    - ### Fields inherited from class org.apache.lucene.search.DocValuesStats

      `field, max, min`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `SortedNumericDocValuesStats(String field, T initialMin, T initialMax)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `hasValue(int doc)` Returns whether the given document has a value for the requested DocValues field.
    `protected boolean` | `init(LeafReaderContext context)` Initializes this object with the given reader context.
    `double` | `mean()` The mean of all values of the field.
    `double` | `stdev()` Returns the stdev of all values of the field.
    `abstract T` | `sum()` Returns the sum of values of the field.
    `long` | `valuesCount()` Returns the total number of values for this field.
    `double` | `variance()` Returns the variance of all values of the field.

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

      `count, doAccumulate, field, max, min, missing`

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

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

- - ### Field Detail

    - #### valuesCount

          protected long valuesCount

    - #### mean

          protected double mean

    - #### variance

          protected double variance

    - #### sndv

          protected SortedNumericDocValues sndv

  - ### Constructor Detail

    - #### SortedNumericDocValuesStats

          protected SortedNumericDocValuesStats(String field,
                                                T initialMin,
                                                T initialMax)

  - ### Method Detail

    - #### init

          protected final boolean init(LeafReaderContext context)
                                throws IOException

      Description copied from class: `DocValuesStats`
      Initializes this object with the given reader context. Returns whether stats can be computed for this segment (i.e. it does have the requested DocValues field).
      Specified by:
        `init` in class `DocValuesStats<T extends Number>`
      Throws:
        `IOException`

    - #### hasValue

          protected final boolean hasValue(int doc)
                                    throws IOException

      Description copied from class: `DocValuesStats`
      Returns whether the given document has a value for the requested DocValues field.
      Specified by:
        `hasValue` in class `DocValuesStats<T extends Number>`
      Throws:
        `IOException`

    - #### mean

          public final double mean()

      The mean of all values of the field.

    - #### variance

          public final double variance()

      Returns the variance of all values of the field.

    - #### stdev

          public final double stdev()

      Returns the stdev of all values of the field.

    - #### valuesCount

          public final long valuesCount()

      Returns the total number of values for this field.

    - #### sum

          public abstract T sum()

      Returns the sum of values of the field. Note that if the values are large, the `sum` might overflow.

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