Class Diff


  • public class Diff
    extends java.lang.Object
    Efficient diffs.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean equalityStrict​(java.lang.Object a, java.lang.Object b)  
      static <T> SimpleDiff<T[]> simpleDiffArray​(T[] a, T[] b)
      Create a diff between two arrays.
      static <T> SimpleDiff<T[]> simpleDiffArray​(T[] a, T[] b, java.util.function.BiPredicate<T,​T> compare)
      Create a diff between two arrays.
      static SimpleDiff<java.lang.String> simpleDiffString​(java.lang.String a, java.lang.String b)
      Create a diff between two strings.
      static SimpleDiff<java.lang.String> simpleDiffStringWithCursor​(java.lang.String a, java.lang.String b, int cursor)
      Diff text and try to diff at the current cursor position.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • simpleDiffString

        public static SimpleDiff<java.lang.String> simpleDiffString​(java.lang.String a,
                                                                    java.lang.String b)
        Create a diff between two strings. This diff implementation is highly efficient, but not very sophisticated.
        Parameters:
        a -
        b -
        Returns:
      • simpleDiffArray

        public static <T> SimpleDiff<T[]> simpleDiffArray​(T[] a,
                                                          T[] b)
        Create a diff between two arrays. This diff implementation is highly efficient, but not very sophisticated.
        Parameters:
        a -
        b -
        Returns:
      • simpleDiffArray

        public static <T> SimpleDiff<T[]> simpleDiffArray​(T[] a,
                                                          T[] b,
                                                          java.util.function.BiPredicate<T,​T> compare)
        Create a diff between two arrays. This diff implementation is highly efficient, but not very sophisticated.
        Type Parameters:
        T -
        Parameters:
        a -
        b -
        compare -
        Returns:
      • simpleDiffStringWithCursor

        public static SimpleDiff<java.lang.String> simpleDiffStringWithCursor​(java.lang.String a,
                                                                              java.lang.String b,
                                                                              int cursor)
        Diff text and try to diff at the current cursor position.
        Parameters:
        a -
        b -
        cursor -
        Returns:
      • equalityStrict

        public static boolean equalityStrict​(java.lang.Object a,
                                             java.lang.Object b)