Class PointMultimapWrapper<T>

    • Method Detail

      • query

        public Index.PointIterator<T> query​(double[] min,
                                            double[] max)
        Specified by:
        query in interface PointMultimap<T>
        Parameters:
        min - Lower left corner of the query window
        max - Upper right corner of the query window
        Returns:
        All points that lie inside the query rectangle.
      • query1nn

        public Index.PointEntryKnn<T> query1nn​(double[] center)
        Description copied from interface: PointMultimap
        Finds the nearest neighbor. This uses Euclidean distance. Other distance types can only be specified directly on the index implementations.
        Specified by:
        query1nn in interface PointMultimap<T>
        Parameters:
        center - center point
        Returns:
        the nearest neighbor
      • queryKnn

        public Index.PointIteratorKnn<T> queryKnn​(double[] center,
                                                  int k)
        Description copied from interface: PointMultimap
        Finds the nearest neighbor. This uses Euclidean distance. Other distance types can only be specified directly on the index implementations.
        Specified by:
        queryKnn in interface PointMultimap<T>
        Parameters:
        center - center point
        k - number of neighbors
        Returns:
        list of nearest neighbors
      • queryKnn

        public Index.PointIteratorKnn<T> queryKnn​(double[] center,
                                                  int k,
                                                  PointDistance distFn)
        Description copied from interface: PointMultimap
        Finds the nearest neighbor. This uses Euclidean distance. Other distance types can only be specified directly on the index implementations.
        Specified by:
        queryKnn in interface PointMultimap<T>
        Parameters:
        center - center point
        k - number of neighbors
        distFn - the point distance function to be used
        Returns:
        list of nearest neighbors
      • insert

        public void insert​(double[] key,
                           T value)
        Description copied from interface: PointMultimap
        Insert a point.
        Specified by:
        insert in interface PointMultimap<T>
        Parameters:
        key - point
        value - value
      • remove

        public boolean remove​(double[] point,
                              T value)
        Description copied from interface: PointMultimap
        Remove *one* entry with the given value.
        Specified by:
        remove in interface PointMultimap<T>
        Parameters:
        point - the point
        value - only entries with this value are removed
        Returns:
        the value of the entry or null if the entry was not found
      • removeIf

        public boolean removeIf​(double[] point,
                                Predicate<Index.PointEntry<T>> condition)
        Description copied from interface: PointMultimap
        Remove *one* entry with the given condition.
        Specified by:
        removeIf in interface PointMultimap<T>
        Parameters:
        point - the point
        condition - the condition required for removing an entry
        Returns:
        the value of the entry or null if the entry was not found
      • queryExactPoint

        public Index.PointIterator<T> queryExactPoint​(double[] point)
        Description copied from interface: PointMultimap
        Lookup an entries at a given coordinate.
        Specified by:
        queryExactPoint in interface PointMultimap<T>
        Parameters:
        point - the point
        Returns:
        an iterator over all entries at the given point
      • update

        public boolean update​(double[] oldPoint,
                              double[] newPoint,
                              T value)
        Description copied from interface: PointMultimap
        Update the position of an entry.
        Specified by:
        update in interface PointMultimap<T>
        Parameters:
        oldPoint - old position
        newPoint - new position
        value - only entries with this value are updated
        Returns:
        the value of the entry or null if the entry was not found
      • contains

        public boolean contains​(double[] point,
                                T value)
        Description copied from interface: PointMultimap
        Lookup an entry, using exact match.
        Specified by:
        contains in interface PointMultimap<T>
        Parameters:
        point - the point
        value - the value
        Returns:
        `true` if an entry was found, otherwise `false`.
      • getDims

        public int getDims()
        Specified by:
        getDims in interface Index
        Returns:
        the number of dimensions
      • size

        public int size()
        Specified by:
        size in interface Index
        Returns:
        the number of entries
      • clear

        public void clear()
        Description copied from interface: Index
        Clear all entries.
        Specified by:
        clear in interface Index
      • getStats

        public Stats getStats()
        Specified by:
        getStats in interface Index
        Returns:
        Collect and return some index statistics. Note that indexes are not required to fill all fields. Also, individual indexes may use subclasses with additional fields.
      • getNodeCount

        public int getNodeCount()
        Specified by:
        getNodeCount in interface Index
      • getDepth

        public int getDepth()
        Specified by:
        getDepth in interface Index
      • toStringTree

        public String toStringTree()
        Specified by:
        toStringTree in interface Index
        Returns:
        a full string output of the tree structure with all entries