Interface BoxMap<T>

    • Method Detail

      • insert

        void insert​(double[] min,
                    double[] max,
                    T value)
        Insert a box.
        Parameters:
        min - minimum corner
        max - maximum corner
        value - value
      • remove

        T remove​(double[] min,
                 double[] max)
        Remove an entry.
        Parameters:
        min - minimum corner
        max - maximum corner
        Returns:
        the value of the entry or null if the entry was not found
      • update

        T update​(double[] minOld,
                 double[] maxOld,
                 double[] minNew,
                 double[] maxNew)
        Update the position of an entry.
        Parameters:
        minOld - old min
        maxOld - old max
        minNew - new min
        maxNew - new max
        Returns:
        the value, or null if the entries was not found
      • contains

        boolean contains​(double[] min,
                         double[] max)
        Lookup an entry, using exact match.
        Parameters:
        min - minimum corner
        max - maximum corner
        Returns:
        `true` if an entry was found, otherwise `false`.
      • queryExact

        T queryExact​(double[] min,
                     double[] max)
        Lookup an entry, using exact match.
        Parameters:
        min - minimum corner
        max - maximum corner
        Returns:
        the value of the entry or null if the entry was not found
      • queryIntersect

        Index.BoxIterator<T> queryIntersect​(double[] min,
                                            double[] max)
        Parameters:
        min - Lower left corner of the query window
        max - Upper right corner of the query window
        Returns:
        All boxes that intersect with the query rectangle.
      • query1nn

        default Index.BoxEntryKnn<T> query1nn​(double[] center)
        Finds the nearest neighbor. This uses Euclidean 'edge distance'. Other distance types can only be specified directly on the index implementations.
        Parameters:
        center - center point
        Returns:
        the nearest neighbor
      • queryKnn

        Index.BoxIteratorKnn<T> queryKnn​(double[] center,
                                         int k)
        Finds the nearest neighbor. This uses Euclidean 'edge distance', i.e. the distance to the edge of a box. Distance is 0 if the box overlaps with the search point. Other distance types can only be specified directly on the index implementations.
        Parameters:
        center - center point
        k - number of neighbors
        Returns:
        list of nearest neighbors