Record Class FixedTextMeasurer.Measurement

java.lang.Object
java.lang.Record
io.leandev.appfuse.pdf.FixedTextMeasurer.Measurement
Record Components:
widthPt - 含字距的行寬(pt)
ascentPt - 所用字型的最大 ascent(pt);空字串以空白字元的字型計算,與 renderer 的空行相同
descentPt - 所用字型的最大 descent(pt,正值)
runs - 依實際使用字型切分的連續片段
Enclosing interface:
FixedTextMeasurer

public static record FixedTextMeasurer.Measurement(double widthPt, double ascentPt, double descentPt, List<FixedTextMeasurer.Run> runs) extends Record
Since:
4.0.0
  • Constructor Details

    • Measurement

      public Measurement(double widthPt, double ascentPt, double descentPt, List<FixedTextMeasurer.Run> runs)
      Creates an instance of a Measurement record class.
      Parameters:
      widthPt - the value for the widthPt record component
      ascentPt - the value for the ascentPt record component
      descentPt - the value for the descentPt record component
      runs - the value for the runs 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.
    • widthPt

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

      public double ascentPt()
      Returns the value of the ascentPt record component.
      Returns:
      the value of the ascentPt record component
    • descentPt

      public double descentPt()
      Returns the value of the descentPt record component.
      Returns:
      the value of the descentPt record component
    • runs

      public List<FixedTextMeasurer.Run> runs()
      Returns the value of the runs record component.
      Returns:
      the value of the runs record component