Clients must supply the input to the differencer as an implementation
of the IRangeComparator interface.
An IRangeComparator breaks the input data into a sequence
of entities and provides a method for comparing
one entity with the entity in another IRangeComparator.
For example, to compare two text documents and find longest common
sequences
of matching and non-matching lines, the implementation of IRangeComparator
must break the document
into lines and provide a method for testing whether two lines are considered
equal.
The differencer returns the differences among these sequences as an
array of RangeDifference objects.
Every single RangeDifference describes kind of difference
(no change, change, addition, deletion)
and the corresponding ranges of the underlying comparable entities
in the two or three inputs.
The algorithm used is an objectified version of one described in:
A File Comparison Program, by Webb Miller and Eugene W. Myers,
Software Practice and Experience, Vol. 15, Nov. 1985.