org.openoffice.xmerge.merger.diff
Class IteratorRowCompare
java.lang.Object
|
+--org.openoffice.xmerge.merger.diff.IteratorRowCompare
- All Implemented Interfaces:
- DiffAlgorithm
- public class IteratorRowCompare
- extends java.lang.Object
- implements DiffAlgorithm
A very simple and direct difference algorithm for row
Node
objects in a spreadsheet. Basically, it will
compare objects in sequence and does not look ahead (unlike LCS).
-
If two objects are the same, skip to next one.
-
Otherwise check whether the row repeated attribute is the same.
-
If the row repeated attribute is the same, then compare two rows
and mark it as change if those rows are different.
-
If the row repeated attribute is different, then split the rows and
continue to compare.
-
If there are more objects in the modseq than the original sequence,
then all of the extra ones in the modified sequence are marked as add.
-
If there are more objects in the original sequence than the modified
sequence, then all the extra one in the modified sequence are marked
as delete.
NOTE: The algorithm will have potential side effect to split rows.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IteratorRowCompare
public IteratorRowCompare()
computeDiffs
public Difference[] computeDiffs(Iterator orgSeq,
Iterator modSeq)
- Compute the differences of the given two sequences.
Refer to the class description.
Return an array of
Difference
objects. This method finds
out the difference between two sequences.
- Specified by:
computeDiffs
in interface DiffAlgorithm
- Parameters:
orgSeq
- The original sequence.modSeq
- The modified (or changed) sequence to
compare against with the origial.- Returns:
- An array of Difference objects.
Copyright © 2002 OpenOffice.org