T - The type of the compared elements in the 'lines'.public class MyersDiff<T,R extends PatchResult<T>> extends java.lang.Object implements DiffAlgorithm<T,R>
| Constructor and Description |
|---|
MyersDiff()
Constructs an instance of the Myers differencing algorithm.
|
MyersDiff(Equalizer<T> equalizer)
Constructs an instance of the Myers differencing algorithm.
|
| Modifier and Type | Method and Description |
|---|---|
PathNode |
buildPath(java.util.List<T> orig,
java.util.List<T> rev)
Computes the minimum diffpath that expresses de differences
between the original and revised sequences, according
to Gene Myers differencing algorithm.
|
Patch<T,R> |
buildRevision(PathNode path,
java.util.List<T> orig,
java.util.List<T> rev)
Constructs a
Patch from a difference path. |
Patch<T,R> |
diff(java.util.List<T> original,
java.util.List<T> revised)
Computes the difference between the original sequence and the revised
sequence and returns it as a
Patch object. |
Patch<T,R> |
diff(T[] original,
T[] revised)
Computes the difference between the original sequence and the revised
sequence and returns it as a
Patch object. |
public MyersDiff()
public Patch<T,R> diff(T[] original, T[] revised)
Patch object.diff in interface DiffAlgorithm<T,R extends PatchResult<T>>original - The original sequence. Must not be null.revised - The revised sequence. Must not be null.public Patch<T,R> diff(java.util.List<T> original, java.util.List<T> revised)
Patch object.
Return empty diff if get the error while procession the difference.
diff in interface DiffAlgorithm<T,R extends PatchResult<T>>original - The original sequence. Must not be null.revised - The revised sequence. Must not be null.null.public PathNode buildPath(java.util.List<T> orig, java.util.List<T> rev) throws DifferentiationFailedException
orig - The original sequence.rev - The revised sequence.Path accross the differences graph.DifferentiationFailedException - if a diff path could not be found.