|
Class: Diff2
Object
|
+--Diff2
|
+--Diff2::HuntMcilroy
|
+--Diff2::MyersUkkonen
- Package:
- stx:libtool
- Category:
- Collections-Sequenceable-Diff
- Version:
- rev:
1.6
date: 2016/10/13 23:23:33
- user: cg
- file: Diff2.st directory: libtool
- module: stx stc-classLibrary: libtool
- Author:
- Tony Garnock-Jones <tonyg@lshift.com>
Generic diff/comm utilities.
Agnostic as to the longestCommonSubsequence algorithm used.
Instance Variables
file1: <SequenceableCollection> One of the two files to compare.
file2: <SequenceableCollection> The other of the files to compare.
[instance variables:]
[class variables:]
accessing
-
HuntMcilroy
-
-
MyersUkkonen
-
instance creation
-
new
-
I'm abstract, so instantiate some default here
accessing
-
file1
-
-
file1: anObject
-
-
file2
-
-
file2: anObject
-
diffing
-
comm
-
Returns a collection of similarities and differences between the two files. Each entry in the resulting collection is either (#common -> {...}) or (#different -> ({...} -> {...})).
-
diff
-
Returns a DiffPatch instance that can be used in future to transform file1 into file2.
-
diffIndices
-
Returns a collection of (DiffChunk -> DiffChunk) associations mapping differing regions of file1 and file2 onto each other.
-
longestCommonSubsequence
-
The longestCommonSubsequence (LCS) algorithm is at the heart of a diff/comm algorithm.
** This method raises an error - it must be redefined in concrete classes **
private
-
addCommonBlock: aSubCollection ifNonEmptyTo: aCollection
-
-
emptyCaches
-
Subclasses should implement this to clear any cached state they may have built up.
-
maybeAddCommonBlock: common to: result p1: p1 p2: p2 limit1: limit1 limit2: limit2
-
For internal use by comm.
-
maybeAddDiffChunkTo: result p1: p1 p2: p2 limit1: limit1 limit2: limit2
-
For internal use by diffIndices.
Chunk
HuntMcilroy
MyersUkkonen
Patch
|