Record Class FixedTextMeasurer.Run

java.lang.Object
java.lang.Record
io.leandev.appfuse.pdf.FixedTextMeasurer.Run
Record Components:
text - 片段文字
font - 實際使用的字型來源(fallback 鏈中第一個含該字者)
widthPt - 片段字寬總和(pt),不含字距
Enclosing interface:
FixedTextMeasurer

public static record FixedTextMeasurer.Run(String text, FontSource font, double widthPt) extends Record
Since:
4.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    Run(String text, FontSource font, double widthPt)
    Creates an instance of a Run record class.
  • Method Summary

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

    Methods inherited from class Object

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

    • Run

      public Run(String text, FontSource font, double widthPt)
      Creates an instance of a Run record class.
      Parameters:
      text - the value for the text record component
      font - the value for the font record component
      widthPt - the value for the widthPt record component
  • 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 the compare method from their corresponding wrapper classes.
      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.
    • text

      public String text()
      Returns the value of the text record component.
      Returns:
      the value of the text record component
    • font

      public FontSource font()
      Returns the value of the font record component.
      Returns:
      the value of the font record component
    • widthPt

      public double widthPt()
      Returns the value of the widthPt record component.
      Returns:
      the value of the widthPt record component