DocValuesStats.NumericDocValuesStats (Lucene 10.5.0 misc API)
Description: declaration: package: org.apache.lucene.misc.search, class: DocValuesStats, class: NumericDocValuesStats

Package org.apache.lucene.misc.search

# Class DocValuesStats.NumericDocValuesStats<T extends Number>

java.lang.Object
org.apache.lucene.misc.search.DocValuesStats<T>
org.apache.lucene.misc.search.DocValuesStats.NumericDocValuesStats<T>

Direct Known Subclasses:
  `DocValuesStats.DoubleDocValuesStats`, `DocValuesStats.LongDocValuesStats`

Enclosing class:
  `DocValuesStats<T>`

public abstract static class DocValuesStats.NumericDocValuesStats<T extends Number> extends DocValuesStats<T>
Holds statistics for a numeric DocValues field.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.lucene.misc.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
  Description
  `protected double`
  `mean`
  `protected NumericDocValues`
  `ndv`
  `protected double`
  `variance`

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

  `count, field, max, min, missing`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `NumericDocValuesStats(String field, T initialMin, T initialMax)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected final boolean`
  `hasValue(int doc)`
  Returns whether the given document has a value for the requested DocValues field.
  `protected final boolean`
  `init(LeafReaderContext context)`
  Initializes this object with the given reader context.
  `final double`
  `mean()`
  The mean of all values of the field.
  `protected void`
  `merge(DocValuesStats<T> other)`
  Merges the statistics from `other` into this instance.
  `final double`
  `stdev()`
  Returns the stdev of all values of the field.
  `abstract T`
  `sum()`
  Returns the sum of values of the field.
  `final double`
  `variance()`
  Returns the variance of all values of the field.

  ### Methods inherited from class org.apache.lucene.misc.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 Details

  - ### mean

    protected double mean

  - ### variance

    protected double variance

  - ### ndv

    protected NumericDocValues ndv

- ## Constructor Details

  - ### NumericDocValuesStats

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

- ## Method Details

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

  - ### sum

    public abstract T sum()
    Returns the sum of values of the field. Note that if the values are large, the `sum` might overflow.

  - ### merge

    protected void merge(DocValuesStats<T> other)
    Description copied from class: `DocValuesStats`
    Merges the statistics from `other` into this instance. After the call, this instance reflects the combined statistics of both segments as if they had been collected together. Subclasses that track additional statistics (e.g. mean, variance, sum) must override this method, call `super.merge(other)`, and combine their own fields accordingly.
    Overrides:
      `merge` in class `DocValuesStats<T extends Number>`
    Parameters:
      `other` - the stats instance to merge into this one; must be of the same concrete type