KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > text > source > ILineDiffInfo


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.jface.text.source;
12
13
14 /**
15  * Describes the change state of one line, which consists of the state of the line itself, which
16  * can be <code>UNCHANGED</code>, <code>CHANGED</code> or <code>ADDED</code>, and the number of
17  * deleted lines before and after this line.
18  * <p>
19  * This interface may be implemented by clients.
20  * </p>
21  *
22  * @since 3.0
23  */

24 public interface ILineDiffInfo {
25
26     /** Denotes an unchanged line. */
27     static final int UNCHANGED= 0;
28
29     /** Denotes an added line. */
30     static final int ADDED= 1;
31
32     /** Denotes a changed line. */
33     static final int CHANGED= 2;
34
35     /**
36      * Returns the number of deleted lines after this line.
37      *
38      * @return the number of lines after this line.
39      */

40     int getRemovedLinesBelow();
41
42     /**
43      * Returns the number of deleted lines before this line.
44      *
45      * @return the number of lines before this line.
46      */

47     int getRemovedLinesAbove();
48
49     /**
50      * Returns the type of this line, one out of <code>UNCHANGED</code>, <code>CHANGED</code> or
51      * <code>ADDED</code>.
52      *
53      * @return the type of this line.
54      */

55     int getChangeType();
56
57     /**
58      * Returns whether this line has any changes (to itself, or any deletions before or after it).
59      *
60      * @return <code>true</code>, if the line's state (as returned by <code>getType</code>) is
61      * either <code>CHANGED</code> or <code>ADDED</code> or either of <code>getRemovedLinesBelow</code>
62      * and <code>getRemovedLinesAbove</code> would return a number &gt; 0
63      */

64     boolean hasChanges();
65
66     /**
67      * Returns the original text of this changed region
68      *
69      * @return the original text of this changed region, including any deleted lines. The returned
70      * value and its elements may not be <code>null/code>, it may however be of zero length
71      */

72     String JavaDoc[] getOriginalText();
73 }
74
Popular Tags