java.lang.Object
org.apache.wicket.util.diff.myers.MyersDiff
- All Implemented Interfaces:
DiffAlgorithm
A clean-room implementation of Eugene Myers
differencing algorithm.
See the paper at http://www.cs.arizona.edu/people/gene/PAPERS/diff.ps
- Version:
- $Revision: 1.1 $ $Date: 2006/03/12 00:24:21 $
- Author:
- Juanco Anez
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic PathNode
Computes the minimum diffpath that expresses de differences between the original and revised sequences, according to Gene Myers differencing algorithm.static Revision
buildRevision
(PathNode path, Object[] orig, Object[] rev) Constructs aRevision
from a difference path.Computes the difference between the original sequence and the revised sequence and returns it as a org.suigeneris.jrcs.diff.Revision Revision object.
-
Constructor Details
-
MyersDiff
public MyersDiff()Constructs an instance of the Myers differencing algorithm.
-
-
Method Details
-
diff
Computes the difference between the original sequence and the revised sequence and returns it as a org.suigeneris.jrcs.diff.Revision Revision object.The revision can be used to construct the revised sequence from the original sequence.
- Specified by:
diff
in interfaceDiffAlgorithm
rev
- the revised text- Returns:
- the revision script.
- Throws:
DifferentiationFailedException
- if the diff could not be computed.
-
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
across the differences graph. - Throws:
DifferentiationFailedException
- if a diff path could not be found.
-
buildRevision
Constructs aRevision
from a difference path.- Parameters:
path
- The path.orig
- The original sequence.rev
- The revised sequence.- Returns:
- A
Revision
script corresponding to the path.
-