Class BatchMerger

java.lang.Object
org.eclipse.emf.compare.merge.BatchMerger
All Implemented Interfaces:
IBatchMerger

public class BatchMerger
extends java.lang.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 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

    Modifier and Type Method Description
    void copyAllLeftToRight​(java.lang.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​(java.lang.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 Details

    • 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 Details