Class MeyersDiffWithLinearSpace<T>
- java.lang.Object
-
- com.github.difflib.algorithm.myers.MeyersDiffWithLinearSpace<T>
-
- All Implemented Interfaces:
DiffAlgorithmI<T>
public class MeyersDiffWithLinearSpace<T> extends java.lang.Object implements DiffAlgorithmI<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
MeyersDiffWithLinearSpace.DiffData
private class
MeyersDiffWithLinearSpace.Snake
-
Constructor Summary
Constructors Constructor Description MeyersDiffWithLinearSpace()
MeyersDiffWithLinearSpace(java.util.function.BiPredicate<T,T> equalizer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
buildScript(MeyersDiffWithLinearSpace.DiffData data, int start1, int end1, int start2, int end2, java.util.function.Consumer<java.lang.Integer> progress)
private MeyersDiffWithLinearSpace.Snake
buildSnake(MeyersDiffWithLinearSpace.DiffData data, int start, int diag, int end1, int end2)
java.util.List<Change>
computeDiff(java.util.List<T> source, java.util.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.private MeyersDiffWithLinearSpace.Snake
getMiddleSnake(MeyersDiffWithLinearSpace.DiffData data, int start1, int end1, int start2, int end2)
-
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
-
-
-
-
Method Detail
-
computeDiff
public java.util.List<Change> computeDiff(java.util.List<T> source, java.util.List<T> target, DiffAlgorithmListener progress)
Description copied from interface:DiffAlgorithmI
Computes the changeset to patch the source list to the target list.- Specified by:
computeDiff
in interfaceDiffAlgorithmI<T>
- Parameters:
source
- source datatarget
- target dataprogress
- progress listener- Returns:
-
buildScript
private void buildScript(MeyersDiffWithLinearSpace.DiffData data, int start1, int end1, int start2, int end2, java.util.function.Consumer<java.lang.Integer> progress)
-
getMiddleSnake
private MeyersDiffWithLinearSpace.Snake getMiddleSnake(MeyersDiffWithLinearSpace.DiffData data, int start1, int end1, int start2, int end2)
-
buildSnake
private MeyersDiffWithLinearSpace.Snake buildSnake(MeyersDiffWithLinearSpace.DiffData data, int start, int diag, int end1, int end2)
-
factory
public static DiffAlgorithmFactory factory()
Factory to create instances of this specific diff algorithm.
-
-