Packages

sealed abstract class Diff[T] extends AnyRef

The result of running Myers' diff algorithm against two IndexedSeq instances. Provides the basic deletes and inserts operations required to transform base into target as well as higher-level logic that refines the basic result (like detecting "move" and "replace" ops).

Instances are created with Diff(base, target).

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Diff
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def allOps: ArraySeq[Op]

    Identifies all operation types (Diff.Op.Delete, Diff.Op.Insert, Diff.Op.Move and Diff.Op.Replace) and returns them sorted by baseIx.

    Identifies all operation types (Diff.Op.Delete, Diff.Op.Insert, Diff.Op.Move and Diff.Op.Replace) and returns them sorted by baseIx.

    The difference to delInsMovOpsSorted is that deletes and inserts targeting the same baseIx are combined into Diff.Op.Replace instances.

  2. abstract def base: IndexedSeq[T]

    The base sequence this Diff was created against.

  3. abstract def basicBimap: Bimap

    Creates a bidirectional index mapping between base and target, without taking moves into account.

    Creates a bidirectional index mapping between base and target, without taking moves into account. This means that elements that have been moved will not have their indices mapped. They simply appear as "not present" in the other sequence.

    The benefit over bimap is the reduced overhead since the O(N^^2) move detection doesn't have to be performed.

  4. abstract def bimap: Bimap

    Creates a bidirectional index mapping between base and target, taking moves into account.

  5. abstract def chunks: ArraySeq[Chunk[T]]

    Segments the inputs into a sequence of chunks representing the diff in a alternative form, that is sometimes better suited to the task at hand than allOps and friends.

  6. abstract def delInsMovOps: ArraySeq[DelInsMov]

    Returns an optimal number of the Diff.Op.DelInsMov operations required to transform base into target.

    Returns an optimal number of the Diff.Op.DelInsMov operations required to transform base into target. Spends an additional O(N^^2) time on finding Diff.Op.Move operations.

    Note that a move is only identified as such if a Diff.Op.Delete has a directly corresponding Diff.Op.Insert. There is no further search for moves in subsets of individual deletes or inserts. Or said differently: Deletes and Inserts are never split to identify potential moves between parts of them.

  7. abstract def delInsMovOpsSorted: ArraySeq[DelInsMov]

    Returns the delInsMovOps sorted by baseIx.

  8. abstract def delInsOps: ArraySeq[DelIns]

    Returns the basic deletes and inserts in one sequence, with the deletes preceding the inserts.

  9. abstract def delInsOpsSorted: ArraySeq[DelIns]

    Returns the delInsOps sorted by baseIx.

  10. abstract def deletes: ArraySeq[Delete]

    The Diff.Op.Delete operations that, together with inserts, are required to transform base into target.

  11. abstract def inserts: ArraySeq[Insert]

    The Diff.Op.Insert operations that, together with deletes, are required to transform base into target.

  12. abstract def longestCommonSubsequence(implicit ct: ClassTag[T]): ArraySeq[T]

    Returns a longest common subsequence of the base and target sequences.

    Returns a longest common subsequence of the base and target sequences. or None, if the two sequences have no elements in common. Stacksafe and reasonably efficient.

    NOTE: If you only need the longestCommonSubsequence then directly calling Diff.longestCommonSubsequence(base, target) is more efficient than Diff(base, target).longestCommonSubsequence!

  13. abstract def minEditDistance: Int

    Returns the minimum number of edits required to transform base and target, whereby one "edit" corresponds to deleting or inserting one single element.

    Returns the minimum number of edits required to transform base and target, whereby one "edit" corresponds to deleting or inserting one single element.

    Same as delInsOps.map(_.count).sum but slightly more efficient.

    NOTE: If you only need the minEditDistance then directly calling Diff.minEditDistance(base, target) is more efficient than Diff(base, target).minEditDistance!

  14. abstract def patch(implicit ct: ClassTag[T]): Patch[T]

    Identifies move operations and packages the diff data into a Diff.Patch instances, which contains all information required to produce the target sequence when only the base sequence is given.

  15. abstract def target: IndexedSeq[T]

    The target sequence this Diff was created against.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  15. def toString(): String
    Definition Classes
    AnyRef → Any
  16. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  17. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped