Implements the difference and patching engine
| Modifier and Type | Field and Description |
|---|---|
| private static Pattern |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static < the type of elements. T> Patch | Returns: The patch describing the difference between the original and revised sequences. Nevernull.The original text. Must not be original, List<T> null.The revised text. Must not be revised)null.Computes the difference between the original and revised list of elements with default diff algorithm |
| public static < the type of elements. T> Patch | Returns: The patch describing the difference between the original and revised sequences. Nevernull.The original text. Must not be original, List<T> null.The revised text. Must not be revised, DiffAlgorithm<T> null.The diff algorithm. Must not be algorithm)null.Computes the difference between the original and revised list of elements with default diff algorithm |
| public static List | Returns: List of strings representing the Unified Diff representation of the Patch argument.Filename of the original (unrevised file) original, String Filename of the revised file revised, List<String> Lines of the original file originalLines, Patch<String> Patch created by the diff() function patch, int number of lines of context output around each difference
in the file. contextSize)generateUnifiedDiff takes a Patch and some other arguments, returning the Unified Diff format text representing the Patch. |
| private static List | Returns: list of String lines of code.the Delta to output delta)getDeltaText returns the lines to be added to the Unified Diff text from the Delta parameter |
| public static Patch | Returns: the patch with deltas.the text in unified format diff)Parse the given text in unified format and creates the list of deltas for it. |
| public static < the type of elements. T> List | |
| private static List | Returns: the Unified-Diff-format textthe lines of the original file origLines, List<Delta<String>> the Deltas to be output as a single block deltas, int the number of lines of context to place around block contextSize)processDeltas takes a list of Deltas and outputs them together in a single block of Unified-Diff-format text. |
| unifiedDiffChunkRe | back to summary |
|---|---|
| private static Pattern unifiedDiffChunkRe | |
| DiffUtils | back to summary |
|---|---|
| public DiffUtils() | |
| diff | back to summary |
|---|---|
| public static <T> Patch Computes the difference between the original and revised list of elements with default diff algorithm | |
| diff | back to summary |
|---|---|
| public static <T> Patch Computes the difference between the original and revised list of elements with default diff algorithm
| |
| generateUnifiedDiff | back to summary |
|---|---|
| public static List generateUnifiedDiff takes a Patch and some other arguments, returning the Unified Diff format text representing the Patch. | |
| getDeltaText | back to summary |
|---|---|
| private static List getDeltaText returns the lines to be added to the Unified Diff text from the Delta parameter | |
| parseUnifiedDiff | back to summary |
|---|---|
| public static Patch Parse the given text in unified format and creates the list of deltas for it. | |
| patch | back to summary |
|---|---|
| public static <T> List Patch the original text with given patch
| |
| processDeltas | back to summary |
|---|---|
| private static List processDeltas takes a list of Deltas and outputs them together in a single block of Unified-Diff-format text. | |