Class Rectangle

java.lang.Object
io.scanbot.sdk.geometry.Rectangle

public class Rectangle extends Object
Represents a rectangle with integer coordinates in 2D space.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Rectangle(int x, int y, int width, int height)
    Constructs a rectangle with given coordinates and dimensions.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the height of the rectangle.
    int
    Returns the width of the rectangle.
    int
    Returns the x-coordinate of the top-left corner of the rectangle.
    int
    Returns the y-coordinate of the top-left corner of the rectangle.
    void
    setHeight(int height)
    Sets the height of the rectangle.
    void
    setWidth(int width)
    Sets the width of the rectangle.
    void
    setX(int x)
    Sets the x-coordinate of the top-left corner of the rectangle.
    void
    setY(int y)
    Sets the y-coordinate of the top-left corner of the rectangle.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Rectangle

      public Rectangle(int x, int y, int width, int height)
      Constructs a rectangle with given coordinates and dimensions.
      Parameters:
      x - x-coordinate of the top-left corner
      y - y-coordinate of the top-left corner
      width - width
      height - height
  • Method Details

    • getX

      public int getX()
      Returns the x-coordinate of the top-left corner of the rectangle.
      Returns:
      x-coordinate
    • setX

      public void setX(int x)
      Sets the x-coordinate of the top-left corner of the rectangle.
      Parameters:
      x - x-coordinate
    • getY

      public int getY()
      Returns the y-coordinate of the top-left corner of the rectangle.
      Returns:
      y-coordinate
    • setY

      public void setY(int y)
      Sets the y-coordinate of the top-left corner of the rectangle.
      Parameters:
      y - y-coordinate
    • getWidth

      public int getWidth()
      Returns the width of the rectangle.
      Returns:
      width
    • setWidth

      public void setWidth(int width)
      Sets the width of the rectangle.
      Parameters:
      width - width
    • getHeight

      public int getHeight()
      Returns the height of the rectangle.
      Returns:
      height
    • setHeight

      public void setHeight(int height)
      Sets the height of the rectangle.
      Parameters:
      height - height