public final class MergeAlgorithm
extends java.lang.Object
HistogramDiff
is used as
diff algorithm.Modifier and Type | Field and Description |
---|---|
private DiffAlgorithm |
diffAlg |
private static Edit |
END_EDIT |
Constructor and Description |
---|
MergeAlgorithm()
Creates a new MergeAlgorithm which uses
HistogramDiff as diff algorithm |
MergeAlgorithm(DiffAlgorithm diff)
Creates a new MergeAlgorithm
|
Modifier and Type | Method and Description |
---|---|
private static boolean |
isEndEdit(Edit edit) |
<S extends Sequence> |
merge(SequenceComparator<S> cmp,
S base,
S ours,
S theirs)
Does the three way merge between a common base and two sequences.
|
private static Edit |
nextEdit(java.util.Iterator<Edit> it)
Helper method which returns the next Edit for an Iterator over Edits.
|
private final DiffAlgorithm diffAlg
private static final Edit END_EDIT
public MergeAlgorithm()
HistogramDiff
as diff algorithmpublic MergeAlgorithm(DiffAlgorithm diff)
diff
- the diff algorithm used by this mergeprivate static boolean isEndEdit(Edit edit)
public <S extends Sequence> MergeResult<S> merge(SequenceComparator<S> cmp, S base, S ours, S theirs)
cmp
- comparison method for this execution.base
- the common base sequenceours
- the first sequence to be mergedtheirs
- the second sequence to be mergedprivate static Edit nextEdit(java.util.Iterator<Edit> it)
it
- the iterator for which the next edit should be returned