public final class GuanoAlgorithm extends Object implements DiffXAlgorithm
Implementation note: this algorithm effectively detects the correct changes in the sequences, but will not necessarily return events that can be serialised as well-formed XML as they stand.
Known problem in this implementation: elements that contain themselves tend to generate events that are harder to serialise as XML.
This class is said 'fit' because it will adapt the matrix to the sequences that it is being given in order to improve performance.
Note: The name of this class comes from a contracted version of the features of this algorithm, as explained below:
| Constructor and Description |
|---|
GuanoAlgorithm(EventSequence seq0,
EventSequence seq1)
Creates a new DiffXAlgorithmBase.
|
| Modifier and Type | Method and Description |
|---|---|
EventSequence |
getFirstSequence()
Returns the first sequence used for the diff-x comparison.
|
EventSequence |
getSecondSequence()
Returns the second sequence used for the diff-x comparison.
|
int |
length()
Returns the length of the longest common sequence.
|
void |
process(DiffXFormatter formatter)
Writes the diff sequence using the specified formatter.
|
public GuanoAlgorithm(EventSequence seq0, EventSequence seq1)
seq0 - The first sequence to compare.seq1 - The second sequence to compare.public int length()
length in interface DiffXAlgorithmpublic void process(DiffXFormatter formatter) throws IOException
process in interface DiffXAlgorithmformatter - The formatter that will handle the output.IOException - If thrown by the formatter.public final EventSequence getFirstSequence()
DiffXAlgorithmgetFirstSequence in interface DiffXAlgorithmDiffXAlgorithm.getFirstSequence()public final EventSequence getSecondSequence()
DiffXAlgorithmgetSecondSequence in interface DiffXAlgorithmDiffXAlgorithm.getSecondSequence()Copyright © 2007-2022. All Rights Reserved.