KickJava   Java API By Example, From Geeks To Geeks.

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


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 import org.eclipse.core.runtime.IPath;
13 import org.eclipse.team.core.diff.provider.Diff;
14
15 /**
16  * A diff describes differences between two or more model objects.
17  * <p>
18  * This interface is not intended to be implemented by clients.
19  * Instead, clients can subclass {@link Diff}.
20  * </p>
21  *
22  * @see ITwoWayDiff
23  * @see IThreeWayDiff
24  * @since 3.2
25  */

26 public interface IDiff {
27
28     /*
29      * ====================================================================
30      * Constants defining diff kinds:
31      * ====================================================================
32      */

33
34     /**
35      * Diff kind constant (bit mask) indicating that the resource has not been changed in
36      * any way.
37      *
38      * @see IDiff#getKind()
39      */

40     public static final int NO_CHANGE = 0;
41
42     /**
43      * Diff kind constant (bit mask) indicating that the resource has been
44      * added to its parent. That is, one that appears in the "after" state, not
45      * in the "before" one.
46      *
47      * @see IDiff#getKind()
48      */

49     public static final int ADD = 0x1;
50
51     /**
52      * Diff kind constant (bit mask) indicating that the resource has been
53      * removed from its parent. That is, one that appears in the "before" state,
54      * not in the "after" one.
55      *
56      * @see IDiff#getKind()
57      */

58     public static final int REMOVE = 0x2;
59
60     /**
61      * Diff kind constant (bit mask) indicating that the resource has been
62      * changed. That is, one that appears in both the "before" and "after"
63      * states.
64      *
65      * @see IDiff#getKind()
66      */

67     public static final int CHANGE = 0x4;
68     
69     /**
70      * Returns the full, absolute path of the object to which the diff applies
71      * with respect to the model root.
72      * <p>
73      * Note: the returned path never has a trailing separator.
74      * </p>
75      *
76      * @return the full, absolute path of this diff
77      */

78     public IPath getPath();
79
80     /**
81      * Returns the kind of this diff. Normally, one of
82      * <code>ADDED</code>, <code>REMOVED</code>, <code>CHANGED</code>.
83      *
84      * @return the kind of this diff
85      * @see IDiff#ADD
86      * @see IDiff#REMOVE
87      * @see IDiff#CHANGE
88      */

89     public int getKind();
90
91     /**
92      * Return a string that describes the difference represented by
93      * this node.
94      * @return a string that describes the difference represented by
95      * this node
96      */

97     public String JavaDoc toDiffString();
98 }
99
Popular Tags