org.hibernate.search.spatial.impl

## Class DistanceComparator

- java.lang.Object
- - org.apache.lucene.search.FieldComparator<T>
  - - org.apache.lucene.search.SimpleFieldComparator<Double>
    - - org.hibernate.search.spatial.impl.DistanceComparator

- All Implemented Interfaces:
    LeafFieldComparator

      public final class DistanceComparator
      extends SimpleFieldComparator<Double>

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DistanceComparator(Point center, int numHits, String fieldName)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compare(int slot1, int slot2)`
    `int` | `compareBottom(int doc)`
    `int` | `compareTop(int doc)`
    `void` | `copy(int slot, int doc)`
    `void` | `doSetNextReader(LeafReaderContext context)`
    `void` | `setBottom(int slot)`
    `void` | `setTopValue(Double value)`
    `Double` | `value(int slot)`

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

      `getLeafComparator, setScorer`

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

      `compareValues`

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

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

- - ### Constructor Detail

    - #### DistanceComparator

          public DistanceComparator(Point center,
                                    int numHits,
                                    String fieldName)

  - ### Method Detail

    - #### compare

          public int compare(int slot1,
                             int slot2)

      Specified by:
        `compare` in class `FieldComparator<Double>`

    - #### setBottom

          public void setBottom(int slot)

    - #### setTopValue

          public void setTopValue(Double value)

      Specified by:
        `setTopValue` in class `FieldComparator<Double>`

    - #### compareBottom

          public int compareBottom(int doc)
                            throws IOException

      Throws:
        `IOException`

    - #### compareTop

          public int compareTop(int doc)
                         throws IOException

      Throws:
        `IOException`

    - #### copy

          public void copy(int slot,
                           int doc)
                    throws IOException

      Throws:
        `IOException`

    - #### doSetNextReader

          public void doSetNextReader(LeafReaderContext context)
                               throws IOException

      Specified by:
        `doSetNextReader` in class `SimpleFieldComparator<Double>`
      Throws:
        `IOException`

    - #### value

          public Double value(int slot)

      Specified by:
        `value` in class `FieldComparator<Double>`

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved