org.eclipse.emf.compare.merge

## Class BatchMerger

- java.lang.Object
- - org.eclipse.emf.compare.merge.BatchMerger

All Implemented Interfaces:
  IBatchMerger

    public class BatchMerger
    extends Object
    implements IBatchMerger

This implementation of an `IBatchMerger` leaves some choice to the client as to what should be merged.

Since:
  3.0

### Constructor Summary

Constructors
Constructor and Description
`BatchMerger(IDiffRelationshipComputer relationshipComputer)` Constructs our batch merger provided the registry from which to retrieve the delegate mergers.
`BatchMerger(IDiffRelationshipComputer relationshipComputer, com.google.common.base.Predicate<? super Diff> filter)` Constructs our batch merger provided the registry from which to retrieve the delegate mergers, and a filter if you only wish to merge specific differences.
`BatchMerger(IMerger.Registry registry)` Constructs our batch merger provided the registry from which to retrieve the delegate mergers.
`BatchMerger(IMerger.Registry registry, com.google.common.base.Predicate<? super Diff> filter)` Constructs our batch merger provided the registry from which to retrieve the delegate mergers, and a filter if you only wish to merge specific differences.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `copyAllLeftToRight(Iterable<? extends Diff> differences, Monitor monitor)` This will be called to copy all of the differences from the given list from the left to the right side.
`void` `copyAllRightToLeft(Iterable<? extends Diff> differences, Monitor monitor)` This will be called to copy all of the differences from the given list from the right to the left side.

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

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

### Constructor Detail

#### BatchMerger

    public BatchMerger(IMerger.Registry registry)

Constructs our batch merger provided the registry from which to retrieve the delegate mergers. Using such a merger will merge every differences passed to its "copy" methods : conflictual or not.

Parameters:
  `registry` - The registry from which we'll retrieve delegate mergers, must be an instance of IMerger.Registry2.

#### BatchMerger

    public BatchMerger(IDiffRelationshipComputer relationshipComputer)

Constructs our batch merger provided the registry from which to retrieve the delegate mergers. Using such a merger will merge every differences passed to its "copy" methods : conflictual or not.

Parameters:
  `relationshipComputer` - The relationship computer used to calculate dependencies and requirements of diffs.
Since:
  3.5

#### BatchMerger

    public BatchMerger(IMerger.Registry registry,
                       com.google.common.base.Predicate<? super Diff> filter)

Constructs our batch merger provided the registry from which to retrieve the delegate mergers, and a filter if you only wish to merge specific differences.

Note that the filter indicates differences that will be merged, not those that will be ignored.

For example, if you wish to ignore all differences in conflict, you can use :

     IMerger.Registry registry = IMerger.RegistryImpl.createStandaloneInstance();
     IBatchMerger bathMerger = new BatchMerger(registry, not(hasConflict(ConflictKind.PSEUDO, ConflictKind.REAL)));
     bathMerger.copyAll...

Parameters:
  `registry` - The registry from which we'll retrieve delegate mergers, must be an instance of IMerger.Registry2.
  `filter` - Additional filter for the differences. This could be set in order to ignore diffs originating from a given side. Note that the filter describes the differences that will be merged, not those that will be ignored.
See Also:
  `Predicates`, `EMFComparePredicates`

#### BatchMerger

    public BatchMerger(IDiffRelationshipComputer relationshipComputer,
                       com.google.common.base.Predicate<? super Diff> filter)

Constructs our batch merger provided the registry from which to retrieve the delegate mergers, and a filter if you only wish to merge specific differences.

Note that the filter indicates differences that will be merged, not those that will be ignored.

For example, if you wish to ignore all differences in conflict, you can use :

     IMerger.Registry registry = IMerger.RegistryImpl.createStandaloneInstance();
     IBatchMerger bathMerger = new BatchMerger(registry, not(hasConflict(ConflictKind.PSEUDO, ConflictKind.REAL)));
     bathMerger.copyAll...

Parameters:
  `filter` - Additional filter for the differences. This could be set in order to ignore diffs originating from a given side. Note that the filter describes the differences that will be merged, not those that will be ignored.
  `relationshipComputer` - The relationship computer used to calculate dependencies and requirements of diffs.
Since:
  3.5
See Also:
  `Predicates`, `EMFComparePredicates`

### Method Detail

#### copyAllLeftToRight

    public void copyAllLeftToRight(Iterable<? extends Diff> differences,
                                   Monitor monitor)

This will be called to copy all of the differences from the given list from the left to the right side.

Note that this may end up merging differences that are not in the given list if one of the diffs to be merged depends on (or results in) the merging of that 'out of list' difference.

Specified by:
  `copyAllLeftToRight` in interface `IBatchMerger`
Parameters:
  `differences` - The differences that will be merged.
  `monitor` - Monitor on which to report progress information.
See Also:
  `IBatchMerger.copyAllLeftToRight(java.lang.Iterable, org.eclipse.emf.common.util.Monitor)`

#### copyAllRightToLeft

    public void copyAllRightToLeft(Iterable<? extends Diff> differences,
                                   Monitor monitor)

This will be called to copy all of the differences from the given list from the right to the left side.

Note that this may end up merging differences that are not in the given list if one of the diffs to be merged depends on (or results in) the merging of that 'out of list' difference.

Specified by:
  `copyAllRightToLeft` in interface `IBatchMerger`
Parameters:
  `differences` - The differences that will be merged.
  `monitor` - Monitor on which to report progress information.
See Also:
  `IBatchMerger.copyAllRightToLeft(java.lang.Iterable, org.eclipse.emf.common.util.Monitor)`