Class LineBasedDiff


  • public class LineBasedDiff
    extends diff_match_patch
    Extends diff_match_patch with a line-based diffing capability.

    This extension is adopted from the descriptions and comments at https://code.google.com/p/google-diff-match-patch/wiki/LineOrWordDiffs

    • Constructor Detail

      • LineBasedDiff

        public LineBasedDiff()
    • Method Detail

      • computeLineBasedDiff

        public LinkedList<diff_match_patch.Diff> computeLineBasedDiff​(String text1,
                                                                      String text2)
        Computes differences between text1 and text2 based on lines only (as opposed to character or word-based diffing).
        Parameters:
        text1 - Version 1 of a text.
        text2 - Version 2 of a text.
        Returns:
        The list of differences.