Record Class PowerpointRun
java.lang.Object
java.lang.Record
pro.verron.officestamper.experimental.PowerpointRun
- Record Components:
startIndex- the start index of the run within the global context.endIndex- the end index of the run within the global context.indexInParent- the index of the run within its parent paragraph.run- the underlyingCTRegularTextRuninstance.
public record PowerpointRun(int startIndex, int endIndex, int indexInParent, org.docx4j.dml.CTRegularTextRun run)
extends Record
A record that represents a run of text in a PowerPoint slide. It holds information
about the run's indices and the underlying text content. The indices define the
range of the text run within a global context, and the backing content is stored
as a CTRegularTextRun instance from the supporting library.
This class provides methods to determine if a text run is affected by a global range of indices and to replace specific substrings within its text.
-
Constructor Summary
ConstructorsConstructorDescriptionPowerpointRun(int startIndex, int endIndex, int indexInParent, org.docx4j.dml.CTRegularTextRun run) Creates an instance of aPowerpointRunrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintendIndex()Returns the value of theendIndexrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theindexInParentrecord component.booleanisTouchedByRange(int globalStartIndex, int globalEndIndex) Checks if the given range of indices touches the start or end index of the run.voidReplaces a substring within the run's text.org.docx4j.dml.CTRegularTextRunrun()Returns the value of therunrecord component.intReturns the value of thestartIndexrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PowerpointRun
public PowerpointRun(int startIndex, int endIndex, int indexInParent, org.docx4j.dml.CTRegularTextRun run) Creates an instance of aPowerpointRunrecord class.- Parameters:
startIndex- the value for thestartIndexrecord componentendIndex- the value for theendIndexrecord componentindexInParent- the value for theindexInParentrecord componentrun- the value for therunrecord 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:
trueif the range touches the start or end index of the run,falseotherwise.
-
replace
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
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
startIndex
public int startIndex()Returns the value of thestartIndexrecord component.- Returns:
- the value of the
startIndexrecord component
-
endIndex
-
indexInParent
public int indexInParent()Returns the value of theindexInParentrecord component.- Returns:
- the value of the
indexInParentrecord component
-
run
-