Package com.github.difflib.patch
Class ChangeDelta<T>
java.lang.Object
com.github.difflib.patch.AbstractDelta<T>
com.github.difflib.patch.ChangeDelta<T>
- Type Parameters:
T
- The type of the compared elements in the data 'lines'.
- All Implemented Interfaces:
Serializable
Describes the change-delta between original and revised texts.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionChangeDelta
(Chunk<T> source, Chunk<T> target) Creates a change delta with the two given chunks. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
applyFuzzyToAt
(List<T> target, int fuzz, int position) Apply patch fuzzy.protected void
protected void
toString()
withChunks
(Chunk<T> original, Chunk<T> revised) Create a new delta of the actual instance with customized chunk data.Methods inherited from class com.github.difflib.patch.AbstractDelta
equals, getSource, getTarget, getType, hashCode, verifyAntApplyTo, verifyChunkToFitTarget
-
Constructor Details
-
ChangeDelta
Creates a change delta with the two given chunks.- Parameters:
source
- The source chunk. Must not benull
.target
- The target chunk. Must not benull
.
-
-
Method Details
-
applyTo
- Specified by:
applyTo
in classAbstractDelta<T>
- Throws:
PatchFailedException
-
restore
- Specified by:
restore
in classAbstractDelta<T>
-
applyFuzzyToAt
Description copied from class:AbstractDelta
Apply patch fuzzy.- Overrides:
applyFuzzyToAt
in classAbstractDelta<T>
- Parameters:
target
- the list this patch will be applied tofuzz
- the number of elements to ignore before/after the patched elementsposition
- the position this patch will be applied to. ignoressource.getPosition()
- Throws:
PatchFailedException
- See Also:
-
- Description of Fuzzy Patch for more information.
-
toString
-
withChunks
Description copied from class:AbstractDelta
Create a new delta of the actual instance with customized chunk data.- Specified by:
withChunks
in classAbstractDelta<T>
-