KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > core > diff > IThreeWayDiff


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
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  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.core.diff;
12
13 import org.eclipse.team.core.diff.provider.ThreeWayDiff;
14
15 /**
16  * A three-way delta that describe the synchronization state between
17  * two contributors and an ancestor. For simplicity, we refer to
18  * one of the contributors as the local and the other as the remote.
19  * A three-way delta is represented as a combination of two two-way
20  * deltas, one between the ancestor and local and the other between the
21  * ancestor and remote. For a three-way delta, clients can assume that
22  * the before state of both the local and remote changes are the same.
23  * <p>
24  * This interface is not intended to be implemented by clients.
25  * Clients that need to create deltas should instead use
26  * {@link ThreeWayDiff}.
27  * </p>
28  * @since 3.2
29  */

30 public interface IThreeWayDiff extends IDiff {
31     
32     /*====================================================================
33      * Constants defining synchronization direction:
34      *====================================================================*/

35     
36     /**
37      * Constant (bit mask) indicating that there is a local change.
38      *
39      * @see IThreeWayDiff#getDirection()
40      */

41     public static final int OUTGOING = 0x100;
42     
43     /**
44      * Constant (bit mask) indicating that there is a local change.
45      *
46      * @see IThreeWayDiff#getDirection()
47      */

48     public static final int INCOMING = 0x200;
49     
50     /**
51      * Constant (bit mask) indicating that there is both a local change
52      * and a remote change.
53      * This flag is equivalent
54      * to <code>OUTGOING | INCOMING</code>.
55      *
56      * @see IThreeWayDiff#getDirection()
57      */

58     public static final int CONFLICTING = OUTGOING | INCOMING;
59     
60     /**
61      * Bit mask for extracting the synchronization direction.
62      */

63     public static final int DIRECTION_MASK = CONFLICTING;
64     
65     /**
66      * Return the local change associated with this delta.
67      * If there is no local change, either a delta with kind
68      * {@link IDiff#NO_CHANGE} is returned or <code>null</code>
69      * may be returned.
70      * @return the local change associated with this delta or <code>null</code>
71      */

72     public ITwoWayDiff getLocalChange();
73     
74     /**
75      * Return the remote change associated with this delta.
76      * If there is no remote change, either a delta with kind
77      * {@link IDiff#NO_CHANGE} is returned or <code>null</code>
78      * may be returned.
79      * @return the remote change associated with this delta or <code>null</code>
80      */

81     public ITwoWayDiff getRemoteChange();
82     
83     /**
84      * Return the direction of this three-way delta.
85      * @return the direction of this three-way delta
86      * @see IThreeWayDiff#INCOMING
87      * @see IThreeWayDiff#OUTGOING
88      * @see IThreeWayDiff#CONFLICTING
89      */

90     public int getDirection();
91
92 }
93
Popular Tags