Class SimpleMBR2D

  • All Implemented Interfaces:
    MBR2D

    public class SimpleMBR2D
    extends Object
    implements MBR2D
    An implementation of MBR that keeps 4 double values for the actual min and max values needed.

    Please note that you should not normally use this class when PRTree wants a MBR since this will actually use a lot of extra memory.

    • Constructor Detail

      • SimpleMBR2D

        public SimpleMBR2D​(double xmin,
                           double ymin,
                           double xmax,
                           double ymax)
        Create a 2D minimum bounding box
        Parameters:
        xmin - the xmin of the MBR
        ymin - the ymin of the MBR
        xmax - the xmax of the MBR
        ymax - the ymax of the MBR
    • Method Detail

      • toString

        public String toString()
        Get a string representation of this mbr.
        Overrides:
        toString in class Object
      • getMinX

        public double getMinX()
        Description copied from interface: MBR2D
        Get the minimum x value
        Specified by:
        getMinX in interface MBR2D
        Returns:
        the x min value
      • getMinY

        public double getMinY()
        Description copied from interface: MBR2D
        Get the minimum y value
        Specified by:
        getMinY in interface MBR2D
        Returns:
        the y min value
      • getMaxX

        public double getMaxX()
        Description copied from interface: MBR2D
        Get the maximum x value
        Specified by:
        getMaxX in interface MBR2D
        Returns:
        the x max value
      • getMaxY

        public double getMaxY()
        Description copied from interface: MBR2D
        Get the maximum y value
        Specified by:
        getMaxY in interface MBR2D
        Returns:
        the y max value
      • union

        public MBR2D union​(MBR2D other)
        Description copied from interface: MBR2D
        Return a new MBR that is the union of this mbr and the other
        Specified by:
        union in interface MBR2D
        Parameters:
        other - the MBR to create a union with
        Returns:
        the new MBR
      • intersects

        public boolean intersects​(MBR2D other)
        Description copied from interface: MBR2D
        Check if the other MBR intersects this one
        Specified by:
        intersects in interface MBR2D
        Parameters:
        other - the MBR to check against
        Returns:
        true if the given MBR intersects with this MBR