Class DiffLines


  • public class DiffLines
    extends DiffBase
    Make diff based on lines.
    • Constructor Summary

      Constructors 
      Constructor Description
      DiffLines​(java.lang.String text1, java.lang.String text2)  
      DiffLines​(java.lang.String text1, java.lang.String text2, DiffOptions options)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String displayPatch​(int before, int after)
      Make a display-patch output with extra lines before and after each change.
      java.lang.String displayPatch​(int before, int after, java.lang.String beforePatch, java.lang.String afterPatch, java.lang.String beforeComment, java.lang.String afterComment, java.lang.String beforeEq, java.lang.String afterEq, java.lang.String beforeAdd, java.lang.String beforeDel, java.lang.String afterChange)
      Make a display-patch output with extra lines before and after each change.
      java.lang.String fullDiff()  
      java.util.LinkedList<Change> getChangeList()
      Get the finished changelist.
      java.lang.String patch()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DiffLines

        public DiffLines​(java.lang.String text1,
                         java.lang.String text2)
      • DiffLines

        public DiffLines​(java.lang.String text1,
                         java.lang.String text2,
                         DiffOptions options)
    • Method Detail

      • fullDiff

        public java.lang.String fullDiff()
        Returns:
        The full diff including unchanged lines.
      • patch

        public java.lang.String patch()
        Returns:
        Make a diff description usable by unix patch program.
      • displayPatch

        public java.lang.String displayPatch​(int before,
                                             int after)
        Make a display-patch output with extra lines before and after each change.
        Parameters:
        before - Number of lines to show before each change.
        after - Number of lines to show after each cange.
        Returns:
        An easy readable display patch string.
      • displayPatch

        public java.lang.String displayPatch​(int before,
                                             int after,
                                             @Nonnull
                                             java.lang.String beforePatch,
                                             @Nonnull
                                             java.lang.String afterPatch,
                                             @Nonnull
                                             java.lang.String beforeComment,
                                             @Nonnull
                                             java.lang.String afterComment,
                                             @Nonnull
                                             java.lang.String beforeEq,
                                             @Nonnull
                                             java.lang.String afterEq,
                                             @Nonnull
                                             java.lang.String beforeAdd,
                                             @Nonnull
                                             java.lang.String beforeDel,
                                             @Nonnull
                                             java.lang.String afterChange)
        Make a display-patch output with extra lines before and after each change.
        Parameters:
        before - Number of lines to show before each change.
        after - Number of lines to show after each cange.
        beforePatch - String to insert before the patch info.
        afterPatch - String to insert after the patch info.
        beforeComment - String to insert before the patch comment.
        afterComment - String to insert after the patch comment.
        beforeEq - String to insert before equal line.
        afterEq - String to insert after equal line.
        beforeAdd - String to insert before added line.
        beforeDel - String to insert before deleted line.
        afterChange - String to insert after any changed line.
        Returns:
        An easy readable display patch string.
      • getChangeList

        public java.util.LinkedList<Change> getChangeList()
        Description copied from class: DiffBase
        Get the finished changelist.
        Specified by:
        getChangeList in class DiffBase
        Returns:
        The list of change and non-change entries, one per line.