|
Class: HuntMcilroy (private in Diff2
This class is only visible from within
Diff2.
Object
|
+--Diff2
|
+--Diff2::HuntMcilroy
- Package:
- stx:libtool
- Category:
- Collections-Sequenceable-Diff
- Owner:
- Diff2
A HuntMcilroyDiff provides a longestCommonSubsequence algorithm following Hunt and McIlroy 1976 for use by the methods on GenericDiff.
J. W. Hunt and M. D. McIlroy, An algorithm for differential file comparison, Bell Telephone Laboratories CSTR #41 (1976).
http://www.cs.dartmouth.edu/~doug/
Instance Variables
lcs: cached longest common subsequence
[instance variables:]
[class variables:]
copyrightCopyright (c) 2007-2012 Tony Garnock-Jones
This code is based on Squeak's DiffMerge package
written by Tony Garnock-Jones. Original project's web site:
http://www.squeaksource.com/DiffMerge
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the 'Software'), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
accessing
-
emptyCaches
-
diffing
-
longestCommonSubsequence
-
(comment from inherited method)
The longestCommonSubsequence (LCS) algorithm is at the heart of a diff/comm algorithm.
private
-
computeEquivalenceClasses
-
-
findCandidateFrom: candidates forLine: file2index startingAt: lowIndex
-
Find the index k in the given subrange of candidates where file2index falls strictly between the file2indexes of the kth and k+1th candidates. If no such k exists, return 0.
-
mergeCandidates: candidates file1index: file1index file2indices: file2indices
-
optimise by leaving early if s was the end of the candidates list, since none of the subsequent file2indices will have a place to go
-
postprocessCandidateChain: candidates
-
-
storeCandidate: c at: r in: candidates
-
Candidate
|