Interface RectangleIntersectionTester

  • All Known Implementing Classes:
    RTreeIntersectionTester


    public interface RectangleIntersectionTester
    A data structure that stores rectangular regions and can be queried with rectangles. Rectangular regions can be added via add(Rectangle, boolean) and queries can be submitted with isFree(Rectangle). Currently the data structure does not support removal operations.
    • Method Summary

      Modifier and Type Method and Description
      void add(Rectangle rectangle, boolean clone)
      Mark the specified rectangle as covered.
      boolean isFree(Rectangle rectangle)
      Query whether the specified region is free.
    • Method Detail

      • add

        void add(Rectangle rectangle,
                 boolean clone)
        Mark the specified rectangle as covered. Subsequent calls to isFree(Rectangle) that intersect the specified rectangle will return false.
        Parameters:
        rectangle - the region to mark as covered
        clone - whether the argument can be stored or it should be cloned to a new object (depends on whether you're reusing the same object on your end)
      • isFree

        boolean isFree(Rectangle rectangle)
        Query whether the specified region is free. A rectangle is free if it does not intersect any of the rectangles added to this data structure with add(Rectangle, boolean) before.
        Parameters:
        rectangle - the region to test for
        Returns:
        whether the region does not intersect any rectangle added before.