Interface QuadTreeIType<A>

    • Method Detail

      • insert

        boolean insert​(A item,
                       com.io7m.jregions.core.unparameterized.areas.AreaI bounds)

        Insert the object item into the quadtree.

        The function returns false if the object could not be inserted for any reason (perhaps due to being too large).

        If the object is already in the tree, it is replaced. This can be used to update the bounds of an object within the tree.

        Parameters:
        item - The object to insert
        bounds - The object's bounds
        Returns:
        true if the object was inserted
      • remove

        boolean remove​(A item)

        Remove the object item from the quadtree.

        The function returns false if the object could not be removed for any reason (perhaps due to not being in the tree in the first place).

        Parameters:
        item - The object to remove
        Returns:
        true if the object was removed
      • clear

        void clear()
        Remove all objects from the tree.
      • trim

        void trim()
        Trim all empty quadrants from the tree.
      • map

        <B> QuadTreeIType<B> map​(java.util.function.BiFunction<A,​com.io7m.jregions.core.unparameterized.areas.AreaI,​B> f)
        Apply f to each element of the tree.
        Specified by:
        map in interface QuadTreeReadableIType<A>
        Type Parameters:
        B - The type of result elements
        Parameters:
        f - A mapping function
        Returns:
        A new tree