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).
- Alphabetic
- By Inheritance
- Diff
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- 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
baseIxare combined into Diff.Op.Replace instances. - abstract def base: IndexedSeq[T]
The base sequence this Diff was created against.
- 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.
- abstract def bimap: Bimap
Creates a bidirectional index mapping between base and target, taking moves into account.
- 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.
- 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.
- abstract def delInsMovOpsSorted: ArraySeq[DelInsMov]
Returns the delInsMovOps sorted by
baseIx. - abstract def delInsOps: ArraySeq[DelIns]
Returns the basic deletes and inserts in one sequence, with the deletes preceding the inserts.
- abstract def delInsOpsSorted: ArraySeq[DelIns]
Returns the delInsOps sorted by
baseIx. - abstract def deletes: ArraySeq[Delete]
The Diff.Op.Delete operations that, together with inserts, are required to transform base into target.
- abstract def inserts: ArraySeq[Insert]
The Diff.Op.Insert operations that, together with deletes, are required to transform base into target.
- abstract def longestCommonSubsequence(implicit ct: ClassTag[T]): ArraySeq[T]
Returns a longest common subsequence of the
baseandtargetsequences.Returns a longest common subsequence of the
baseandtargetsequences. or None, if the two sequences have no elements in common. Stacksafe and reasonably efficient.NOTE: If you only need the
longestCommonSubsequencethen directly callingDiff.longestCommonSubsequence(base, target)is more efficient thanDiff(base, target).longestCommonSubsequence! - abstract def minEditDistance: Int
Returns the minimum number of edits required to transform
baseandtarget, whereby one "edit" corresponds to deleting or inserting one single element.Returns the minimum number of edits required to transform
baseandtarget, whereby one "edit" corresponds to deleting or inserting one single element.Same as
delInsOps.map(_.count).sumbut slightly more efficient.NOTE: If you only need the
minEditDistancethen directly callingDiff.minEditDistance(base, target)is more efficient thanDiff(base, target).minEditDistance! - 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
targetsequence when only thebasesequence is given. - abstract def target: IndexedSeq[T]
The target sequence this Diff was created against.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated