Package org.stianloader.stianknn

# Interface SpatialRingIndex1NN<T>

Type Parameters:
  `T` - The type of the elements stored in the index.

All Superinterfaces:
  `SpatialIndex1NN<T>`

All Known Implementing Classes:
  `SpatialBufferedQueryArray`, `SpatialQueryArrayLegacy`

public interface SpatialRingIndex1NN<T> extends SpatialIndex1NN<T>
A 2D spatial index that is capable of looking up the nearest element within a defined ring around a provided point. That is, it returns the element with the smallest distance larger than a provided minimum distance to a provided point, ensuring that the returned element has no distance larger than a provided maximum distance. These distances may be arbitrarily large or small - that is `Float.NEGATIVE_INFINITY` or `Float.POSITIVE_INFINITY` are perfectly acceptable and would result in behaviour more comparable to a `SpatialIndex1NN`.

Mutability is undefined for this interface, it is best to assume that it is unsupported. The behaviour of elements with equal distance (and thus overlapping points) are undefined by this interface.

Keep in mind that `query1nn(float, float, float, float)` works with squared distances, this is mainly motivated by performance concerns.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default T`
  `query1nn(float x, float y)`
  `T`
  `query1nn(float x, float y, float minDistanceSquared, float maxDistanceSquared)`

- ## Method Details

  - ### query1nn

    @Nullable default T query1nn(float x, float y)
    Specified by:
      `query1nn` in interface `SpatialIndex1NN<T>`

  - ### query1nn

    @Nullable T query1nn(float x, float y, float minDistanceSquared, float maxDistanceSquared)