|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdifflib.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
| Constructor Summary | |
|---|---|
MyersDiff()
Constructs an instance of the Myers differencing algorithm. |
|
| Method Summary | ||
|---|---|---|
static PathNode |
buildPath(Object[] orig,
Object[] rev)
Computes the minimum diffpath that expresses de differences between the original and revised sequences, according to Gene Myers differencing algorithm. |
|
static Patch |
buildRevision(PathNode path,
Object[] orig,
Object[] rev)
Constructs a Patch from a difference path. |
|
static
|
copyOfRange(T[] original,
int from,
int to)
Copied here from JDK 1.6 |
|
static
|
copyOfRange(U[] original,
int from,
int to,
Class<? extends T[]> newType)
Copied here from JDK 1.6 |
|
Patch |
diff(List<?> original,
List<?> revised)
Computes the difference between the original sequence and the revised sequence and returns it as a Patch object. |
|
Patch |
diff(Object[] orig,
Object[] rev)
Computes the difference between the original sequence and the revised sequence and returns it as a Patch 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 Patch diff(List<?> original,
List<?> revised)
Patch object.
Return empty diff if get the error while procession the difference.
diff in interface DiffAlgorithmoriginal - the original textrevised - the revised text
public Patch diff(Object[] orig,
Object[] rev)
Patch object.
Return empty diff if get the error while procession the difference.
diff in interface DiffAlgorithmorig - the original textrev - the revised text
public static PathNode buildPath(Object[] orig,
Object[] 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.
public static Patch buildRevision(PathNode path,
Object[] orig,
Object[] rev)
Patch from a difference path.
path - The path.orig - The original sequence.rev - The revised sequence.
Patch script corresponding to the path.
DifferentiationFailedException - if a Patch could
not be built from the given path.
public static <T> T[] copyOfRange(T[] original,
int from,
int to)
public static <T,U> T[] copyOfRange(U[] original,
int from,
int to,
Class<? extends T[]> newType)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||