Class MeyersDiff<T>
java.lang.Object
com.github.difflib.algorithm.myers.MeyersDiff<T>
- All Implemented Interfaces:
DiffAlgorithmI<T>
A clean-room implementation of Eugene Meyers greedy differencing algorithm.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate PathNode
Computes the minimum diffpath that expresses de differences between the original and revised sequences, according to Gene Myers differencing algorithm.Constructs aPatch
from a difference path.computeDiff
(List<T> source, List<T> target, DiffAlgorithmListener progress) Computes the changeset to patch the source list to the target list.static DiffAlgorithmFactory
factory()
Factory to create instances of this specific diff algorithm.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.github.difflib.algorithm.DiffAlgorithmI
computeDiff
-
Field Details
-
equalizer
-
-
Constructor Details
-
MeyersDiff
public MeyersDiff() -
MeyersDiff
-
-
Method Details
-
computeDiff
Computes the changeset to patch the source list to the target list. Return empty diff if get the error while procession the difference.- Specified by:
computeDiff
in interfaceDiffAlgorithmI<T>
- Parameters:
source
- source datatarget
- target dataprogress
- progress listener- Returns:
-
buildPath
Computes the minimum diffpath that expresses de differences between the original and revised sequences, according to Gene Myers differencing algorithm.- Parameters:
orig
- The original sequence.rev
- The revised sequence.- Returns:
- A minimum
Path
accross the differences graph. - Throws:
DifferentiationFailedException
- if a diff path could not be found.
-
buildRevision
Constructs aPatch
from a difference path. -
factory
Factory to create instances of this specific diff algorithm.
-