org.apache.lucene.search

## Class FieldComparator.NumericComparator<T extends Number>

- java.lang.Object
- - org.apache.lucene.search.FieldComparator<T>
  - - org.apache.lucene.search.SimpleFieldComparator<T>
    - - org.apache.lucene.search.FieldComparator.NumericComparator<T>

- All Implemented Interfaces:
    LeafFieldComparator
  Direct Known Subclasses:
    FieldComparator.DoubleComparator, FieldComparator.FloatComparator, FieldComparator.IntComparator, FieldComparator.LongComparator
  Enclosing class:
    FieldComparator<T>

      public abstract static class FieldComparator.NumericComparator<T extends Number>
      extends SimpleFieldComparator<T>

  Base FieldComparator class for numeric types

- - ### Nested Class Summary

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

      `FieldComparator.DocComparator, FieldComparator.DoubleComparator, FieldComparator.FloatComparator, FieldComparator.IntComparator, FieldComparator.LongComparator, FieldComparator.NumericComparator<T extends Number>, FieldComparator.RelevanceComparator, FieldComparator.TermOrdValComparator, FieldComparator.TermValComparator`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected NumericDocValues` | `currentReaderValues`
    `protected Bits` | `docsWithField`
    `protected String` | `field`
    `protected T` | `missingValue`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NumericComparator(String field, T missingValue)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `doSetNextReader(LeafReaderContext context)` This method is called before collecting `context`.
    `protected Bits` | `getDocsWithValue(LeafReaderContext context, String field)` Retrieves a `Bits` instance representing documents that have a value in this segment.
    `protected NumericDocValues` | `getNumericDocValues(LeafReaderContext context, String field)` Retrieves the NumericDocValues for the field in this segment

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

      `getLeafComparator, setScorer`

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

      `compare, compareValues, setTopValue, value`

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

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

    - ### Methods inherited from interface org.apache.lucene.search.LeafFieldComparator

      `compareBottom, compareTop, copy, setBottom`

- - ### Field Detail

    - #### missingValue

          protected final T extends Number missingValue

    - #### field

          protected final String field

    - #### docsWithField

          protected Bits docsWithField

    - #### currentReaderValues

          protected NumericDocValues currentReaderValues

  - ### Constructor Detail

    - #### NumericComparator

          public NumericComparator(String field,
                                   T missingValue)

  - ### Method Detail

    - #### doSetNextReader

          protected void doSetNextReader(LeafReaderContext context)
                                  throws IOException

      Description copied from class: `SimpleFieldComparator`
      This method is called before collecting `context`.
      Specified by:
        `doSetNextReader` in class `SimpleFieldComparator<T extends Number>`
      Throws:
        `IOException`

    - #### getNumericDocValues

          protected NumericDocValues getNumericDocValues(LeafReaderContext context,
                                                         String field)
                                                  throws IOException

      Retrieves the NumericDocValues for the field in this segment
      Throws:
        `IOException`

    - #### getDocsWithValue

          protected Bits getDocsWithValue(LeafReaderContext context,
                                          String field)
                                   throws IOException

      Retrieves a `Bits` instance representing documents that have a value in this segment.
      Throws:
        `IOException`

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