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
ConstructorDescriptionPowerpointRun
(int startIndex, int endIndex, int indexInParent, org.docx4j.dml.CTRegularTextRun run) Creates an instance of aPowerpointRun
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
endIndex()
Returns the value of theendIndex
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of theindexInParent
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
Replaces a substring within the run's text.org.docx4j.dml.CTRegularTextRun
run()
Returns the value of therun
record component.int
Returns the value of thestartIndex
record component.final String
toString()
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 aPowerpointRun
record class.- Parameters:
startIndex
- the value for thestartIndex
record componentendIndex
- the value for theendIndex
record componentindexInParent
- the value for theindexInParent
record componentrun
- the value for therun
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
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 thestartIndex
record component.- Returns:
- the value of the
startIndex
record component
-
endIndex
public int endIndex()Returns the value of theendIndex
record component.- Returns:
- the value of the
endIndex
record component
-
indexInParent
public int indexInParent()Returns the value of theindexInParent
record component.- Returns:
- the value of the
indexInParent
record component
-
run
public org.docx4j.dml.CTRegularTextRun run()Returns the value of therun
record component.- Returns:
- the value of the
run
record component
-