|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdifflib.DiffUtils
public class DiffUtils
Implements the difference and patching engine
| Constructor Summary | |
|---|---|
DiffUtils()
|
|
| Method Summary | |
|---|---|
static Patch |
diff(List<?> original,
List<?> revised)
Compute the difference between the original and revised texts with default diff algorithm |
static Patch |
diff(List<?> original,
List<?> revised,
DiffAlgorithm algorithm)
Compute the difference between the original and revised texts with given diff algorithm |
static List<String> |
generateUnifiedDiff(String original,
String revised,
List<String> originalLines,
Patch patch,
int contextSize)
generateUnifiedDiff takes a Patch and some other arguments, returning the Unified Diff format text representing the Patch. |
static Patch |
parseUnifiedDiff(List<String> diff)
Parse the given text in unified format and creates the list of deltas for it. |
static List<?> |
patch(List<?> original,
Patch patch)
Patch the original text with given patch |
static List<?> |
unpatch(List<?> revised,
Patch patch)
Unpatch the revised text for a given patch |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DiffUtils()
| Method Detail |
|---|
public static Patch diff(List<?> original,
List<?> revised)
original - the original textrevised - the revised text
public static Patch diff(List<?> original,
List<?> revised,
DiffAlgorithm algorithm)
original - the original textrevised - the revised textalgorithm - the given algorithm
public static List<?> patch(List<?> original,
Patch patch)
throws PatchFailedException
original - the original textpatch - the given patch
PatchFailedException - if can't apply patch
public static List<?> unpatch(List<?> revised,
Patch patch)
revised - the revised textpatch - the given patch
public static Patch parseUnifiedDiff(List<String> diff)
diff - the text in unified format
public static List<String> generateUnifiedDiff(String original,
String revised,
List<String> originalLines,
Patch patch,
int contextSize)
original - - Filename of the original (unrevised file)revised - - Filename of the revised fileoriginalLines - - Lines of the original filepatch - - Patch created by the diff() functioncontextSize - - number of lines of context output around each difference in the file.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||