Record Class LytRect

java.lang.Object
java.lang.Record
guideme.document.LytRect

public record LytRect(int x, int y, int width, int height) extends Record
  • Constructor Details

    • LytRect

      public LytRect(int x, int y, int width, int height)
      Creates an instance of a LytRect record class.
      Parameters:
      x - the value for the x record component
      y - the value for the y record component
      width - the value for the width record component
      height - the value for the height record component
  • Method Details

    • empty

      public static LytRect empty()
    • right

      public int right()
    • bottom

      public int bottom()
    • isEmpty

      public boolean isEmpty()
    • shrink

      public LytRect shrink(int left, int top, int right, int bottom)
    • expand

      public LytRect expand(int amount)
    • expand

      public LytRect expand(int left, int top, int right, int bottom)
    • withWidth

      public LytRect withWidth(int width)
    • withHeight

      public LytRect withHeight(int height)
    • move

      public LytRect move(int x, int y)
    • centerIn

      public LytRect centerIn(LytRect other)
    • centerHorizontallyIn

      public LytRect centerHorizontallyIn(LytRect other)
    • centerVerticallyIn

      public LytRect centerVerticallyIn(LytRect other)
    • union

      public static LytRect union(LytRect a, LytRect b)
    • contains

      public boolean contains(LytPoint point)
    • contains

      public boolean contains(int x, int y)
    • intersects

      public boolean intersects(LytRect other)
    • withX

      public LytRect withX(int x)
    • withY

      public LytRect withY(int y)
    • transform

      public LytRect transform(org.joml.Matrix4f pose)
    • size

      public LytSize size()
    • point

      public org.joml.Vector2i point()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • x

      public int x()
      Returns the value of the x record component.
      Returns:
      the value of the x record component
    • y

      public int y()
      Returns the value of the y record component.
      Returns:
      the value of the y record component
    • width

      public int width()
      Returns the value of the width record component.
      Returns:
      the value of the width record component
    • height

      public int height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component