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 underlyingCTRegularTextRun
instance.
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 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
-
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 thecompare
method from their corresponding wrapper classes. -
startIndex
public int startIndex()Returns the value of thestartIndex
record component.- Returns:
- the value of the
startIndex
record component
-
endIndex
-
indexInParent
public int indexInParent()Returns the value of theindexInParent
record component.- Returns:
- the value of the
indexInParent
record component
-
run
-