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 voidapplyFuzzyToAt(List<T> target, int fuzz, int position) Apply patch fuzzy.protected voidprotected voidtoString()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:
applyToin classAbstractDelta<T>- Throws:
PatchFailedException
-
restore
- Specified by:
restorein classAbstractDelta<T>
-
applyFuzzyToAt
Description copied from class:AbstractDeltaApply patch fuzzy.- Overrides:
applyFuzzyToAtin 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:
-
toString
-
withChunks
Description copied from class:AbstractDeltaCreate a new delta of the actual instance with customized chunk data.- Specified by:
withChunksin classAbstractDelta<T>
-