Class Rectangle

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class Rectangle extends ProxyInstance
A data structure for holding a rectangle.
Since:
2.46
  • Constructor Summary

    Constructors
    Constructor
    Description
    Allocate a new Rectangle.
    Rectangle(double x, double y, double width, double height)
    Allocate a new Rectangle with the fields set to the provided values.
    Rectangle(double x, double y, double width, double height, Arena arena)
    Allocate a new Rectangle with the fields set to the provided values.
    Allocate a new Rectangle.
    Create a Rectangle proxy instance for the provided memory address.
  • Method Summary

    Modifier and Type
    Method
    Description
    The memory layout of the native struct.
    double
    Read the value of the field height.
    double
    Read the value of the field width.
    double
    Read the value of the field x.
    double
    Read the value of the field y.
    void
    writeHeight(double height)
    Write a value in the field height.
    void
    writeWidth(double width)
    Write a value in the field width.
    void
    writeX(double x)
    Write a value in the field x.
    void
    writeY(double y)
    Write a value in the field y.

    Methods inherited from class ProxyInstance

    equals, handle, hashCode

    Methods inherited from class Object

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

    • Rectangle

      public Rectangle(MemorySegment address)
      Create a Rectangle proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • Rectangle

      public Rectangle(Arena arena)
      Allocate a new Rectangle.
      Parameters:
      arena - to control the memory allocation scope
    • Rectangle

      public Rectangle()
      Allocate a new Rectangle. The memory is allocated with Arena.ofAuto().
    • Rectangle

      public Rectangle(double x, double y, double width, double height, Arena arena)
      Allocate a new Rectangle with the fields set to the provided values.
      Parameters:
      x - value for the field x
      y - value for the field y
      width - value for the field width
      height - value for the field height
      arena - to control the memory allocation scope
    • Rectangle

      public Rectangle(double x, double y, double width, double height)
      Allocate a new Rectangle with the fields set to the provided values. The memory is allocated with Arena.ofAuto().
      Parameters:
      x - value for the field x
      y - value for the field y
      width - value for the field width
      height - value for the field height
  • Method Details

    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • readX

      public double readX()
      Read the value of the field x.
      Returns:
      The value of the field x
    • writeX

      public void writeX(double x)
      Write a value in the field x.
      Parameters:
      x - The new value for the field x
    • readY

      public double readY()
      Read the value of the field y.
      Returns:
      The value of the field y
    • writeY

      public void writeY(double y)
      Write a value in the field y.
      Parameters:
      y - The new value for the field y
    • readWidth

      public double readWidth()
      Read the value of the field width.
      Returns:
      The value of the field width
    • writeWidth

      public void writeWidth(double width)
      Write a value in the field width.
      Parameters:
      width - The new value for the field width
    • readHeight

      public double readHeight()
      Read the value of the field height.
      Returns:
      The value of the field height
    • writeHeight

      public void writeHeight(double height)
      Write a value in the field height.
      Parameters:
      height - The new value for the field height