org.apache.lucene.spatial.tier

## Class DistanceFilter

- java.lang.Object
- - org.apache.lucene.search.Filter
  - - org.apache.lucene.spatial.tier.DistanceFilter

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    GeoHashDistanceFilter, LatLongDistanceFilter

      public abstract class DistanceFilter
      extends org.apache.lucene.search.Filter

  NOTE: This API is still in flux and might change in incompatible ways in the next release.

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected double` | `distance`
    `protected java.util.WeakHashMap<java.lang.String,java.lang.Double>` | `distanceLookupCache`
    `protected java.util.Map<java.lang.Integer,java.lang.Double>` | `distances`
    `protected int` | `nextDocBase`
    `protected DistanceHandler.Precision` | `precise`
    `protected org.apache.lucene.search.Filter` | `startingFilter`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DistanceFilter(org.apache.lucene.search.Filter startingFilter, double distance)` Filters the startingFilter by precise distance checking filter

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract boolean` | `equals(java.lang.Object o)` Returns true if `o` is equal to this.
    `java.lang.Double` | `getDistance(int docid)`
    `java.util.Map<java.lang.Integer,java.lang.Double>` | `getDistances()`
    `abstract int` | `hashCode()` Returns a hash code value for this object.
    `void` | `reset()` You must call this before re-using this DistanceFilter across searches
    `void` | `setDistances(java.util.Map<java.lang.Integer,java.lang.Double> distances)`

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

      `bits, getDocIdSet`

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

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

- - ### Field Detail

    - #### startingFilter

          protected final org.apache.lucene.search.Filter startingFilter

    - #### precise

          protected DistanceHandler.Precision precise

    - #### distances

          protected java.util.Map<java.lang.Integer,java.lang.Double> distances

    - #### distance

          protected double distance

    - #### nextDocBase

          protected int nextDocBase

    - #### distanceLookupCache

          protected final java.util.WeakHashMap<java.lang.String,java.lang.Double> distanceLookupCache

  - ### Constructor Detail

    - #### DistanceFilter

          public DistanceFilter(org.apache.lucene.search.Filter startingFilter,
                                double distance)

      Filters the startingFilter by precise distance checking filter

  - ### Method Detail

    - #### getDistances

          public java.util.Map<java.lang.Integer,java.lang.Double> getDistances()

    - #### getDistance

          public java.lang.Double getDistance(int docid)

    - #### setDistances

          public void setDistances(java.util.Map<java.lang.Integer,java.lang.Double> distances)

    - #### reset

          public void reset()

      You must call this before re-using this DistanceFilter across searches

    - #### equals

          public abstract boolean equals(java.lang.Object o)

      Returns true if `o` is equal to this.
      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public abstract int hashCode()

      Returns a hash code value for this object.
      Overrides:
        `hashCode` in class `java.lang.Object`

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