Skip to main content
summaryrefslogtreecommitdiffstats
blob: ed888525c2fa7c760803ee628b0962b8c2e62e35 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*******************************************************************************
 * Copyright (c) 2009, 2011 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.compare.rangedifferencer;

/**
 * @since org.eclipse.compare.core 3.5
 */
public abstract class AbstractRangeDifferenceFactory {
	protected abstract RangeDifference createRangeDifference();

	RangeDifference createRangeDifference(int changeKind) {
		RangeDifference rangeDifference = createRangeDifference();
		rangeDifference.kind = changeKind;
		return rangeDifference;
	}

	RangeDifference createRangeDifference(int kind, int rightStart,
			int rightLength, int leftStart, int leftLength) {
		RangeDifference rangeDifference = createRangeDifference();
		rangeDifference.kind = kind;
		rangeDifference.rightStart = rightStart;
		rangeDifference.rightLength = rightLength;
		rangeDifference.leftStart = leftStart;
		rangeDifference.leftLength = leftLength;
		return rangeDifference;
	}

	RangeDifference createRangeDifference(int kind, int rightStart,
			int rightLength, int leftStart, int leftLength, int ancestorStart,
			int ancestorLength) {
		RangeDifference rangeDifference = createRangeDifference();
		rangeDifference.kind = kind;
		rangeDifference.rightStart = rightStart;
		rangeDifference.rightLength = rightLength;
		rangeDifference.leftStart = leftStart;
		rangeDifference.leftLength = leftLength;
		rangeDifference.ancestorStart = ancestorStart;
		rangeDifference.ancestorLength = ancestorLength;
		return rangeDifference;
	}
}

Back to the top