eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Diff2':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: Diff2


Inheritance:

   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>

Description:


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:]


Related information:



Class protocol:

accessing
o  HuntMcilroy

o  MyersUkkonen

instance creation
o  new
I'm abstract, so instantiate some default here


Instance protocol:

accessing
o  file1

o  file1: anObject

o  file2

o  file2: anObject

diffing
o  comm
Returns a collection of similarities and differences between the two files. Each entry in the resulting collection is either (#common -> {...}) or (#different -> ({...} -> {...})).

o  diff
Returns a DiffPatch instance that can be used in future to transform file1 into file2.

o  diffIndices
Returns a collection of (DiffChunk -> DiffChunk) associations mapping differing regions of file1 and file2 onto each other.

o  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
o  addCommonBlock: aSubCollection ifNonEmptyTo: aCollection

o  emptyCaches
Subclasses should implement this to clear any cached state they may have built up.

o  maybeAddCommonBlock: common to: result p1: p1 p2: p2 limit1: limit1 limit2: limit2
For internal use by comm.

o  maybeAddDiffChunkTo: result p1: p1 p2: p2 limit1: limit1 limit2: limit2
For internal use by diffIndices.


Private classes:

    Chunk
    HuntMcilroy
    MyersUkkonen
    Patch


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 29 Mar 2024 00:28:42 GMT