Class Rectangle2D_I32


public class Rectangle2D_I32 extends Object
An axis aligned rectangle in 2D that is specified by its lower extent (x0,y0), and upper extent (x1,y1). x0 ≤ x1 and y0 ≤ y1. (x1,y1) is exclusive and not contained in the rectangle.
  • Field Details

    • x0

      public int x0
      Lower extent
    • y0

      public int y0
      Lower extent
    • x1

      public int x1
      Upper extent
    • y1

      public int y1
      Upper extent
  • Constructor Details

    • Rectangle2D_I32

      public Rectangle2D_I32(int x0, int y0, int x1, int y1)
    • Rectangle2D_I32

      public Rectangle2D_I32(Rectangle2D_I32 orig)
    • Rectangle2D_I32

      public Rectangle2D_I32()
  • Method Details

    • setTo

      public Rectangle2D_I32 setTo(Rectangle2D_I32 orig)
    • setTo

      public Rectangle2D_I32 setTo(int x0, int y0, int x1, int y1)
    • zero

      public void zero()
      Sets the value of all fields to zero
    • enforceExtents

      public void enforceExtents()
      Makes sure x0,y0 is the lower extent and x1,y1 is the upper extent
    • getCorner

      public Point2D_I32 getCorner(int index, @Nullable @Nullable Point2D_I32 corner)
      Provides access to corners in the order specified below.
       [0] = (x0, y0)
       [1] = (x1, y0)
       [2] = (x1, y1)
       [3] = (x0, y1)
      where w = width, and h = height.
      index - Which corner
      corner - (Optional) storage for the corner
      The corner
    • isEquals

      public boolean isEquals(int x0, int y0, int x1, int y1)
    • getWidth

      public int getWidth()
    • getHeight

      public int getHeight()
    • area

      public int area()
    • toString

      public String toString()
      toString in class Object
    • equals

      public boolean equals(Object obj)
      equals in class Object
    • hashCode

      public int hashCode()
      hashCode in class Object