Class Bisect


  • public class Bisect
    extends DiffBase
    Find the 'middle snake' of a diff, split the problem in two and return the recursively constructed diff. See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.
    • Constructor Detail

      • Bisect

        public Bisect​(java.lang.String text1,
                      java.lang.String text2)
        Bisect two strings.
        Parameters:
        text1 - Source (old) string.
        text2 - Target (new) string.
      • Bisect

        public Bisect​(java.lang.String text1,
                      java.lang.String text2,
                      DiffOptions options)
        Bisect two strings.
        Parameters:
        text1 - Source (old) string.
        text2 - Target (new) string.
        options - DiffOptions to use.
    • Method Detail

      • getChangeList

        public java.util.LinkedList<Change> getChangeList()
        Description copied from class: DiffBase
        Get the finished changelist.
        Specified by:
        getChangeList in class DiffBase
        Returns:
        List of changes.
      • fromDelta

        public static Bisect fromDelta​(java.lang.String text1,
                                       java.lang.String delta)
                                throws java.lang.IllegalArgumentException
        Given the original text1, and an encoded string which describes the operations required to transform text1 into text2, compute the full diff.
        Parameters:
        text1 - Source string for the diff.
        delta - Delta text.
        Returns:
        Array of DiffBase objects or null if invalid.
        Throws:
        java.lang.IllegalArgumentException - If invalid input.