Record Class PageRegion

java.lang.Object
java.lang.Record
com.vaadin.flow.component.ai.common.PageRegion
Record Components:
page - the 1-based page number; 1 when the source has a single surface, such as an image
rect - the area on the page, not null
All Implemented Interfaces:
SourceLocation, Serializable

public record PageRegion(int page, Rect rect) extends Record implements SourceLocation
A rectangular area on a page of the source document. The meaning of the rectangle is fixed — always fractions of the page as the user sees it — but its accuracy is the model's: the rectangle is never checked against the document, so it points a reviewer at an area rather than measuring one.
Since:
25.3
Author:
Vaadin Ltd
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    PageRegion(int page, Rect rect)
    Creates a new page region.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the page record component.
    Returns the value of the rect record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • PageRegion

      public PageRegion(int page, Rect rect)
      Creates a new page region.
      Parameters:
      page - the 1-based page number
      rect - the area on the page, not null
      Throws:
      NullPointerException - if rect is null
      IllegalArgumentException - if page is less than 1
  • Method Details

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • page

      public int page()
      Returns the value of the page record component.
      Returns:
      the value of the page record component
    • rect

      public Rect rect()
      Returns the value of the rect record component.
      Returns:
      the value of the rect record component