Package org.stianloader.stianknn

# Interface SpatialIndexIterable<E>

All Superinterfaces:
  `SpatialIndex1NN<E>`, `SpatialIndexKNN<E>`

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

public interface SpatialIndexIterable<E> extends SpatialIndexKNN<E>
A 2D spatial index that is capable of looking up an arbitrary amount of elements based on the distance of a point.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Iterator<@NotNull E>`
  `createIterator(float x, float y)`
  Create an iterator that fetches the element close to the point defined by the parameters `x` and `y`.

  ### Methods inherited from interface org.stianloader.stianknn.SpatialIndex1NN

  `query1nn`

  ### Methods inherited from interface org.stianloader.stianknn.SpatialIndexKNN

  `queryKnn`

- ## Method Details

  - ### createIterator

    Iterator<@NotNull E> createIterator(float x, float y)
    Create an iterator that fetches the element close to the point defined by the parameters `x` and `y`. The iterator will return the elements closest to the point first, then return the elements further away from the point.

    Note that the iterator may be inefficient when fetching large amounts of points, though it concretely depends on the implementation.

    Parameters:
      `x` - The x component of the position of the point which will be the origin for the proximity evaluations.
      `y` - The y component of the position of the point which will be the origin for the proximity evaluations.
    Returns:
      An iterator that iterates over the elements based on the proximity from the given point.