Class Area.Rectangular

    • Constructor Detail

      • Rectangular

        public Rectangular​(Coordinate position)
        Generates an area containing a single coordinate
      • Rectangular

        public Rectangular​(Coordinate bottomLeft,
                           Coordinate topRight)
        Constructs a rectangular Area from the bottom left and top right coordinates
        Parameters:
        bottomLeft - The bottom left coordinate of the Area (Inclusive)
        topRight - The top right coordinate of the Area (Inclusive)
    • Method Detail

      • grow

        @NonNull
        public Area.Rectangular grow​(int horizontal,
                                     int vertical)
        Parameters:
        horizontal - the amount to grow horizontally on each side on the x axis
        vertical - the amount to grow vertically on each side on the y axis
        Returns:
        an enlarged (or shrunk if negative values are used) Area.Rectangular
      • getBottomLeft

        public Coordinate getBottomLeft()
      • getBottomRight

        public Coordinate getBottomRight()
      • getHeight

        public int getHeight()
      • getCoordinates

        public java.util.List<Coordinate> getCoordinates()
        Description copied from class: Area
        Gets a list of all coordinates within the area
        Specified by:
        getCoordinates in class Area
      • getSurrounding

        @Deprecated
        public java.util.List<Coordinate> getSurrounding()
        Deprecated.
        Get the coordinates surrounding this rectangular area
      • getSurroundingCoordinates

        public java.util.List<Coordinate> getSurroundingCoordinates()
      • toRectangular

        public Area.Rectangular toRectangular()
        Description copied from class: Area
        Converts an Area into a Area.Rectangular that contains the entire Area
        Specified by:
        toRectangular in class Area
      • getWidth

        public int getWidth()
      • contains

        public boolean contains​(Locatable locatable,
                                boolean ignorePlane)
        Overrides:
        contains in class Area
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in class Area
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in class Area
      • toString

        public java.lang.String toString()
        Specified by:
        toString in class Area