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:
java.io.Serializable
public final class ChangeDelta<T> extends AbstractDelta<T>
Describes the change-delta between original and revised texts.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ChangeDelta(Chunk<T> source, Chunk<T> target)
Creates a change delta with the two given chunks.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyFuzzyToAt(java.util.List<T> target, int fuzz, int position)
Apply patch fuzzy.protected void
applyTo(java.util.List<T> target)
protected void
restore(java.util.List<T> target)
java.lang.String
toString()
AbstractDelta<T>
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
-
-
-
-
Method Detail
-
applyTo
protected void applyTo(java.util.List<T> target) throws PatchFailedException
- Specified by:
applyTo
in classAbstractDelta<T>
- Throws:
PatchFailedException
-
restore
protected void restore(java.util.List<T> target)
- Specified by:
restore
in classAbstractDelta<T>
-
applyFuzzyToAt
protected void applyFuzzyToAt(java.util.List<T> target, int fuzz, int position) throws PatchFailedException
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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
withChunks
public AbstractDelta<T> withChunks(Chunk<T> original, Chunk<T> revised)
Description copied from class:AbstractDelta
Create a new delta of the actual instance with customized chunk data.- Specified by:
withChunks
in classAbstractDelta<T>
-
-