Package limn.graphics

Record Class ShapedText.Span

java.lang.Object
java.lang.Record
limn.graphics.ShapedText.Span
Record Components:
x0 - left edge
x1 - right edge, never less than x0
Enclosing class:
ShapedText

public static record ShapedText.Span(float x0, float x1) extends Record
One horizontal box of a selection, in logical points from the left edge of the line. Horizontal only: the band is the caller's, drawn from ShapedText.metrics(), so one box serves a selection fill, an IME underline and a composition highlight alike.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Span(float x0, float x1)
    Creates an instance of a Span record class.
  • 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.
    final String
    Returns a string representation of this record class.
    float
    x1 - x0.
    float
    x0()
    Returns the value of the x0 record component.
    float
    x1()
    Returns the value of the x1 record component.

    Methods inherited from class java.lang.Object

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

    • Span

      public Span(float x0, float x1)
      Creates an instance of a Span record class.
      Parameters:
      x0 - the value for the x0 record component
      x1 - the value for the x1 record component
  • Method Details

    • width

      public float width()
      x1 - x0.
    • 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.
    • x0

      public float x0()
      Returns the value of the x0 record component.
      Returns:
      the value of the x0 record component
    • x1

      public float x1()
      Returns the value of the x1 record component.
      Returns:
      the value of the x1 record component