Module pro.verron.officestamper
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
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
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. -
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. -
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 '=='. -
startIndex
public int startIndex()Returns the value of thestartIndexrecord component.- Returns:
- the value of the
startIndexrecord component
-
endIndex
public int endIndex()Returns the value of theendIndexrecord component.- Returns:
- the value of the
endIndexrecord component
-
indexInParent
public int indexInParent()Returns the value of theindexInParentrecord component.- Returns:
- the value of the
indexInParentrecord component
-
run
public org.docx4j.dml.CTRegularTextRun run()Returns the value of therunrecord component.- Returns:
- the value of the
runrecord component
-