OpenOffice.org
XMerge API

org.openoffice.xmerge.merger.diff
Class CharArrayLCSAlgorithm

java.lang.Object
  |
  +--org.openoffice.xmerge.merger.diff.CharArrayLCSAlgorithm

public class CharArrayLCSAlgorithm
extends java.lang.Object

This is an implementations of DiffAlgorithm interface which will difference char arrays.

It also use Longest Common Subsequence (LCS). The algorithm 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
CharArrayLCSAlgorithm()
           
 
Method Summary
 Difference[] computeDiffs(char[] orgSeq, char[] modSeq)
          Return an Difference array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CharArrayLCSAlgorithm

public CharArrayLCSAlgorithm()
Method Detail

computeDiffs

public Difference[] computeDiffs(char[] orgSeq,
                                 char[] modSeq)
Return an Difference array. This method finds out the difference between two sequences.
Parameters:
orgSeq - The original sequence.
modSeq - The modified (or changed) sequence to compare against the origial.
Returns:
A Difference array.

OpenOffice.org
XMerge API

Copyright © 2002 OpenOffice.org