OpenOffice.org
XMerge API

org.openoffice.xmerge.merger.diff
Class IteratorLCSAlgorithm

java.lang.Object
  |
  +--org.openoffice.xmerge.merger.diff.IteratorLCSAlgorithm
All Implemented Interfaces:
DiffAlgorithm

public class IteratorLCSAlgorithm
extends java.lang.Object
implements DiffAlgorithm

This is one of the implementations of DiffAlgorithm interface. Using Longest Common Subsequence (LCS). The algorithm here is based on the book "Introduction to Algorithms" by Thomas H.Cormen, Charles E.Leiserson and Ronald L.Riverst (MIT Press 1990) page 314.


Constructor Summary
IteratorLCSAlgorithm()
           
 
Method Summary
 Difference[] computeDiffs(Iterator orgSeq, Iterator modSeq)
          Returns a Difference array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IteratorLCSAlgorithm

public IteratorLCSAlgorithm()
Method Detail

computeDiffs

public Difference[] computeDiffs(Iterator orgSeq,
                                 Iterator modSeq)
Description copied from interface: DiffAlgorithm
Returns a Difference array. This method finds out the difference between two sequences.
Specified by:
computeDiffs in interface DiffAlgorithm
Following copied from interface: org.openoffice.xmerge.merger.DiffAlgorithm
Parameters:
orgSeq - The original sequence of object.
modSeq - The modified (or changed) sequence to compare against with the origial.
Returns:
A Difference array.

OpenOffice.org
XMerge API

Copyright © 2002 OpenOffice.org