A class to compare vectors of objects. The result of comparison
is a list of change objects which form an
edit script. The objects compared are traditionally lines
of text from two files. Comparison options such as "ignore
whitespace" are implemented by modifying the equals
and hashcode methods for the objects compared.
The basic algorithm is described in:
"An O(ND) Difference Algorithm and its Variations", Eugene Myers,
Algorithmica Vol. 1 No. 2, 1986, p 251.
This class outputs different results from GNU diff 1.15 on some
inputs. Our results are actually better (smaller change list, smaller
total size of changes), but it would be nice to know why. Perhaps
there is a memory overwrite bug in GNU diff 1.15.
author: Stuart D. Gathman, translated from GNU diff 1.15 author: Copyright (C) 2000 Business Management Systems, Inc. author: author: This program is free software; you can redistribute it and/or modify author: it under the terms of the GNU General Public License as published by author: the Free Software Foundation; either version 1, or (at your option) author: any later version. author:
author: This program is distributed in the hope that it will be useful, author: but WITHOUT ANY WARRANTY; without even the implied warranty of author: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the author: GNU General Public License for more details. author:
author: You should have received a copy of the author: GNU General Public License author: along with this program; if not, write to the Free Software author: Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|