KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > compare > rangedifferencer > LinkedRangeDifference


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.compare.rangedifferencer;
12
13 /* package */ class LinkedRangeDifference extends RangeDifference {
14
15     static final int INSERT= 0;
16     static final int DELETE= 1;
17
18     LinkedRangeDifference fNext;
19
20     /*
21      * Creates a LinkedRangeDifference an initializes it to the error state
22      */

23     LinkedRangeDifference() {
24         super(ERROR);
25         fNext= null;
26     }
27
28     /*
29      * Constructs and links a LinkeRangeDifference to another LinkedRangeDifference
30      */

31     LinkedRangeDifference(LinkedRangeDifference next, int operation) {
32         super(operation);
33         fNext= next;
34     }
35
36     /*
37      * Follows the next link
38      */

39     LinkedRangeDifference getNext() {
40         return fNext;
41     }
42
43     boolean isDelete() {
44         return kind() == DELETE;
45     }
46
47     boolean isInsert() {
48         return kind() == INSERT;
49     }
50
51     /*
52      * Sets the next link of this LinkedRangeDifference
53      */

54     void setNext(LinkedRangeDifference next) {
55         fNext= next;
56     }
57 }
58
Popular Tags