|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.util.diff.myers.MyersDiff
public class MyersDiff
A clean-room implementation of Eugene Myers differencing algorithm.
See the paper at http://www.cs.arizona.edu/people/gene/PAPERS/diff.ps
Delta
,
Revision
,
Diff
Constructor Summary | |
---|---|
MyersDiff()
Constructs an instance of the Myers differencing algorithm. |
Method Summary | |
---|---|
static PathNode |
buildPath(java.lang.Object[] orig,
java.lang.Object[] rev)
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,
java.lang.Object[] orig,
java.lang.Object[] rev)
Constructs a Revision from a difference path. |
Revision |
diff(java.lang.Object[] orig,
java.lang.Object[] rev)
Computes the difference between the original sequence and the revised sequence and returns it as a Revision object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MyersDiff()
Method Detail |
---|
public Revision diff(java.lang.Object[] orig, java.lang.Object[] rev) throws DifferentiationFailedException
Revision
object.
The revision can be used to construct the revised sequence from the original sequence.
diff
in interface DiffAlgorithm
rev
- the revised text
DifferentiationFailedException
- if the diff could not be computed.public static PathNode buildPath(java.lang.Object[] orig, java.lang.Object[] rev) throws DifferentiationFailedException
orig
- The original sequence.rev
- The revised sequence.
Path
across the differences graph.
DifferentiationFailedException
- if a diff path could not be found.public static Revision buildRevision(PathNode path, java.lang.Object[] orig, java.lang.Object[] rev)
Revision
from a difference path.
path
- The path.orig
- The original sequence.rev
- The revised sequence.
Revision
script corresponding to the path.
DifferentiationFailedException
- if a Revision
could not be built from the given path.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |