org.apache.lucene.search

## Class FieldComparator.NumericComparator<T extends Number>

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

- Direct Known Subclasses:
    FieldComparator.ByteComparator, FieldComparator.DoubleComparator, FieldComparator.FloatComparator, FieldComparator.IntComparator, FieldComparator.LongComparator, FieldComparator.ShortComparator
  Enclosing class:
    FieldComparator<T>

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

  Base FieldComparator class for numeric types

- - ### Nested Class Summary

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

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

  - ### Field Summary

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

  - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `FieldComparator<T>` | `setNextReader(AtomicReaderContext context)` Set a new `AtomicReaderContext`.

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

      `compare, compareBottom, compareDocToValue, compareValues, copy, setBottom, setScorer, value`

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

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

- - ### Field Detail

    - #### missingValue

          protected final T extends Number missingValue

    - #### field

          protected final String field

    - #### docsWithField

          protected Bits docsWithField

  - ### Constructor Detail

    - #### FieldComparator.NumericComparator

          public FieldComparator.NumericComparator(String field,
                                           T missingValue)

  - ### Method Detail

    - #### setNextReader

          public FieldComparator<T> setNextReader(AtomicReaderContext context)
                                                          throws IOException

      Description copied from class: `FieldComparator`
      Set a new `AtomicReaderContext`. All subsequent docIDs are relative to the current reader (you must add docBase if you need to map it to a top-level docID).
      Specified by:
        `setNextReader` in class `FieldComparator<T extends Number>`
      Parameters:
        `context` - current reader context
      Returns:
        the comparator to use for this segment; most comparators can just return "this" to reuse the same comparator across segments
      Throws:
        `IOException` - if there is a low-level IO error

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