Package org.eclipse.jgit.merge

## Class MergeAlgorithm

- java.lang.Object
- - org.eclipse.jgit.merge.MergeAlgorithm

    public final class MergeAlgorithm
    extends Object

Provides the merge algorithm which does a three-way merge on content provided as RawText. By default `HistogramDiff` is used as diff algorithm.

### Constructor Summary

Constructors
`MergeAlgorithm()` Creates a new MergeAlgorithm which uses `HistogramDiff` as diff algorithm
`MergeAlgorithm​(DiffAlgorithm diff)` Creates a new MergeAlgorithm

### Method Summary

All Methods Instance Methods Concrete Methods
`<S extends Sequence> MergeResult<S>` `merge​(SequenceComparator<S> cmp, S base, S ours, S theirs)` Does the three way merge between a common base and two sequences.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### MergeAlgorithm

    public MergeAlgorithm()

Creates a new MergeAlgorithm which uses `HistogramDiff` as diff algorithm

#### MergeAlgorithm

    public MergeAlgorithm​(DiffAlgorithm diff)

Creates a new MergeAlgorithm

Parameters:
  `diff` - the diff algorithm used by this merge

### Method Detail

#### merge

    public <S extends Sequence> MergeResult<S> merge​(SequenceComparator<S> cmp,
                                                     S base,
                                                     S ours,
                                                     S theirs)

Does the three way merge between a common base and two sequences.

Type Parameters:
  `S` - type of sequence.
Parameters:
  `cmp` - comparison method for this execution.
  `base` - the common base sequence
  `ours` - the first sequence to be merged
  `theirs` - the second sequence to be merged
Returns:
  the resulting content