Class Diff

java.lang.Object
io.keikai.doc.collab.lib0.Diff

public class Diff extends Object
Efficient diffs.
  • Method Details

    • simpleDiffString

      public static SimpleDiff<String> simpleDiffString(String a, 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, 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<String> simpleDiffStringWithCursor(String a, 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(Object a, Object b)