Fix some of the warnings
[EMFCompare2.git] / plugins / org.eclipse.emf.compare / src / org / eclipse / emf / compare / merge / IMerger2.java
blobf2587a8a3cac1e9ed7b336a3845377a7537ec300
1 /*******************************************************************************
2 * Copyright (c) 2014 Obeo.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Obeo - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.emf.compare.merge;
13 import java.util.Set;
15 import org.eclipse.emf.compare.Diff;
17 /**
18 * This adds the ability for {@link IMerger mergers} to define their own sub-set of "required" differences.
19 * <p>
20 * This set of differences is what will be used by the UI to highlight related differences, by the batch
21 * merger to determine whether the diff can be merged beforehand (one of the related being in conflict will
22 * prevent the merge as a whole), ...
23 * </p>
24 * <p>
25 * The {@link AbstractMerger} implements this and can be sub-classed instead when the default set of
26 * requirements is enough.
27 * </p>
29 * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
30 * @since 3.2
32 public interface IMerger2 extends IMerger {
33 /**
34 * Retrieves the set of <b>directly</b> required diffs in order to merge the current one. This may
35 * includes the diff's {@link Diff#getRequires() requirements}, its {@link Diff#getImpliedBy() implying
36 * diff}, or any other diff that we need to merge <u>before</u> the given one.
38 * @param diff
39 * The diff which direct requirements we need.
40 * @param mergeLeftToRight
41 * The direction in which we're considering a merge.
42 * @return The set of <b>directly</b> required diffs in order to merge the current one.
44 Set<Diff> getDirectMergeDependencies(Diff diff, boolean mergeLeftToRight);
46 /**
47 * Returns all differences that will be merged because of our merging the given <code>target</code>
48 * difference.
50 * @param target
51 * The difference we're considering merging.
52 * @param mergeRightToLeft
53 * The direction in which we're considering a merge.
54 * @return The Set of all differences that will be merged because we've merged <code>target</code>.
56 Set<Diff> getDirectResultingMerges(Diff target, boolean mergeRightToLeft);
58 /**
59 * Returns the set of all differences that need to be rejected if <code>target</code> is merged in the
60 * given direction.
62 * @param target
63 * The difference we're considering merging.
64 * @param mergeRightToLeft
65 * The direction in which we're considering a merge.
66 * @return The Set of all differences that will be rejected if we are to merge merged <code>target</code>.
68 Set<Diff> getDirectResultingRejections(Diff target, boolean mergeRightToLeft);