01: /*
02: Copyright 2001 Nicholas Allen (nallen@freenet.co.uk)
03: This file is part of JavaCVS.
04: JavaCVS is free software; you can redistribute it and/or modify
05: it under the terms of the GNU General Public License as published by
06: the Free Software Foundation; either version 2 of the License, or
07: (at your option) any later version.
08: JavaCVS is distributed in the hope that it will be useful,
09: but WITHOUT ANY WARRANTY; without even the implied warranty of
10: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11: GNU General Public License for more details.
12: You should have received a copy of the GNU General Public License
13: along with JavaCVS; if not, write to the Free Software
14: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15: */
16: package allensoft.diff;
17:
18: /**
19: * DOCUMENT ME!
20: *
21: * @author $author$
22: */
23: public class Insertion extends Difference {
24: private int m_nEndLineInFile2;
25: private String m_sInsertedText;
26:
27: /**
28: * Creates a new Insertion object.
29: *
30: * @param nStartLineInFile1 DOCUMENT ME!
31: * @param nStartLineInFile2 DOCUMENT ME!
32: * @param nEndLineInFile2 DOCUMENT ME!
33: * @param sInsertedText DOCUMENT ME!
34: */
35: public Insertion(int nStartLineInFile1, int nStartLineInFile2,
36: int nEndLineInFile2, String sInsertedText) {
37: super (nStartLineInFile1, nStartLineInFile2);
38: m_nEndLineInFile2 = nEndLineInFile2;
39: m_sInsertedText = sInsertedText;
40: }
41:
42: /**
43: * DOCUMENT ME!
44: *
45: * @return DOCUMENT ME!
46: */
47: public int getEndLineInFile2() {
48: return m_nEndLineInFile2;
49: }
50:
51: /**
52: * DOCUMENT ME!
53: *
54: * @return DOCUMENT ME!
55: */
56: public String getInsertedText() {
57: return m_sInsertedText;
58: }
59:
60: /**
61: * DOCUMENT ME!
62: *
63: * @return DOCUMENT ME!
64: */
65: public String toString() {
66: return getStartLineInFile1() + "a" + getStartLineInFile2()
67: + "," + getEndLineInFile2() + "\n" + m_sInsertedText;
68: }
69: }
|