Class Rectangle

java.lang.Object
com.myscript.iink.graphics.Rectangle

public class Rectangle extends Object
Represents an axis aligned rectangle on the 2D plane.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    float
    The height of the rectangle.
    float
    The width of the rectangle.
    float
    The x position of the left edge of the rectangle.
    float
    The y position of the top edge of the rectangle.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
    Rectangle(float x, float y, float width, float height)
    Constructor.
    Rectangle(@NotNull Rectangle other)
    Copy constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(@Nullable Object obj)
     
    int
     
    @NotNull String
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • x

      public float x
      The x position of the left edge of the rectangle.
    • y

      public float y
      The y position of the top edge of the rectangle.
    • width

      public float width
      The width of the rectangle.
    • height

      public float height
      The height of the rectangle.
  • Constructor Details

    • Rectangle

      public Rectangle(float x, float y, float width, float height)
      Constructor.
      Parameters:
      x - the x position of the left edge of the rectangle.
      y - the y position of the top edge of the rectangle.
      width - the width of the rectangle.
      height - the height of the rectangle.
    • Rectangle

      public Rectangle(@NotNull @NotNull Rectangle other)
      Copy constructor.
      Parameters:
      other - copied object.
    • Rectangle

      public Rectangle()
      Default constructor. Builds an empty Rectangle at the coordinate (0 ; 0)
  • Method Details

    • equals

      public boolean equals(@Nullable @Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @NotNull public @NotNull String toString()
      Overrides:
      toString in class Object