Record Class PowerpointRun

java.lang.Object
java.lang.Record
pro.verron.officestamper.experimental.PowerpointRun

public record PowerpointRun(int startIndex, int endIndex, int indexInParent, org.docx4j.dml.CTRegularTextRun run) extends Record
Represents a run within a PowerPoint slide.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PowerpointRun(int startIndex, int endIndex, int indexInParent, org.docx4j.dml.CTRegularTextRun run)
    Creates an instance of a PowerpointRun record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the endIndex record component.
    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 indexInParent record component.
    boolean
    isTouchedByRange(int globalStartIndex, int globalEndIndex)
    Checks if the given range of indices touches the start or end index of the run.
    void
    replace(int globalStartIndex, int globalEndIndex, String replacement)
    Replaces a substring within the run's text.
    org.docx4j.dml.CTRegularTextRun
    run()
    Returns the value of the run record component.
    int
    Returns the value of the startIndex 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

    • PowerpointRun

      public PowerpointRun(int startIndex, int endIndex, int indexInParent, org.docx4j.dml.CTRegularTextRun run)
      Creates an instance of a PowerpointRun record class.
      Parameters:
      startIndex - the value for the startIndex record component
      endIndex - the value for the endIndex record component
      indexInParent - the value for the indexInParent record component
      run - the value for the run record component
  • Method Details

    • isTouchedByRange

      public boolean isTouchedByRange(int globalStartIndex, int globalEndIndex)
      Checks if the given range of indices touches the start or end index of the run.
      Parameters:
      globalStartIndex - the start index of the global range.
      globalEndIndex - the end index of the global range.
      Returns:
      true if the range touches the start or end index of the run, false otherwise.
    • replace

      public void replace(int globalStartIndex, int globalEndIndex, String replacement)
      Replaces a substring within the run's text.
      Parameters:
      globalStartIndex - the start index of the substring to be replaced.
      globalEndIndex - the end index of the substring to be replaced.
      replacement - the replacement string.
    • 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.
    • startIndex

      public int startIndex()
      Returns the value of the startIndex record component.
      Returns:
      the value of the startIndex record component
    • endIndex

      public int endIndex()
      Returns the value of the endIndex record component.
      Returns:
      the value of the endIndex record component
    • indexInParent

      public int indexInParent()
      Returns the value of the indexInParent record component.
      Returns:
      the value of the indexInParent record component
    • run

      public org.docx4j.dml.CTRegularTextRun run()
      Returns the value of the run record component.
      Returns:
      the value of the run record component