Package limn.scene

Record Class Change.TextEdit

java.lang.Object
java.lang.Record
limn.scene.Change.TextEdit
Record Components:
origin - what moved the edit
offset - where the damaged range begins, in chars
removed - how many chars it replaced
inserted - how many chars it inserted
All Implemented Interfaces:
Change
Enclosing interface:
Change

public static record Change.TextEdit(Change.Origin origin, int offset, int removed, int inserted) extends Record implements Change
A text edit: aspect() is always Change.Aspect.TEXT, so aspect() == TEXT and instanceof Change.TextEdit are the same question in both directions.
  • Constructor Details

    • TextEdit

      public TextEdit(Change.Origin origin, int offset, int removed, int inserted)
      Creates an instance of a TextEdit record class.
      Parameters:
      origin - the value for the origin record component
      offset - the value for the offset record component
      removed - the value for the removed record component
      inserted - the value for the inserted record component
  • Method Details

    • aspect

      public Change.Aspect aspect()
      Specified by:
      aspect in interface Change
      Returns:
      what about the widget changed
    • 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.
    • origin

      public Change.Origin origin()
      Returns the value of the origin record component.
      Specified by:
      origin in interface Change
      Returns:
      the value of the origin record component
    • offset

      public int offset()
      Returns the value of the offset record component.
      Returns:
      the value of the offset record component
    • removed

      public int removed()
      Returns the value of the removed record component.
      Returns:
      the value of the removed record component
    • inserted

      public int inserted()
      Returns the value of the inserted record component.
      Returns:
      the value of the inserted record component