This library implements the algorithm described by Chawathe et al in the following paper
- Implement the
Node
interface for nodes in your tree - Implement a
MatchingCriteria
based on the tree you want to diff. - Instantiate an instance of
DefaultMatch
orFastMatch
. At this point theFastMatch
implementation is slower thanDefaultMatch
. I have to spend time profiling it. - Calculate a matching by calling
calculateMatching
on the DefaultMatch instance. - Instantiate an instance of
EditScriptAlgorithm
passing in the matching obtained in the previous step and an instance ofSimpleLCSAlgorithm
- Call
calculateEditScript
to get a the edit script for your tree
Look at EditScriptAlgorithmTest.case1()
for an example of what your code should look like.