Package com.deltawalker.script
Interface DeltaRange
- All Superinterfaces:
Delta
A block of text found by a
TextComparison: an offset and a length in
the document of each Role, together with the Delta.Kind of
difference. Use TextComparison.getText(Role, int, int) to read the
text a range refers to.
const text = comp.getText(Role.REF, range.offset(Role.REF), range.length(Role.REF));
- Since:
- 2.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.deltawalker.script.Delta
Delta.Kind -
Method Summary
Modifier and TypeMethodDescriptionReturns the inline differences within this block of text.booleanAnswers whether this difference has been resolved by a merge.intReturns the length, in characters, of this range in the document with the specifiedRole.intReturns the offset of this range in the document with the specifiedRole.Methods inherited from interface com.deltawalker.script.Delta
getParent, hasChildren, isAdded, isChanged, isConflict, isDeleted, isOverallKind, isPseudoConflict, isSame, kind
-
Method Details
-
getChildren
DeltaRange[] getChildren()Returns the inline differences within this block of text. A text comparison first finds blocks of text that were added, deleted or are present on both sides; a second pass over the blocks present on both sides finds the individual characters that differ within them, the inline differences.- Specified by:
getChildrenin interfaceDelta- Returns:
- an array of inline
DeltaRanges; empty when there are none - Since:
- 2.0
-
isResolved
boolean isResolved()Answers whether this difference has been resolved by a merge.- Returns:
trueif this difference has been resolved,falseotherwise.- Since:
- 2.0
-
length
Returns the length, in characters, of this range in the document with the specifiedRole.- Parameters:
role- a role of this comparison; cannot benull- Returns:
- the length of this range in the document with the specified
role - Throws:
NullPointerException- if role isnullIllegalArgumentException- if the specified role is not applicable to this comparison.- Since:
- 2.0
-
offset
Returns the offset of this range in the document with the specifiedRole.- Parameters:
role- a role of this comparison; cannot benull- Returns:
- the 0-based offset of this delta into the content of the document
identified by
role - Throws:
NullPointerException- if role isnullIllegalArgumentException- if the specified role is not applicable to this comparison.- Since:
- 2.0
-