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 Change extends Difference {
24: private int m_nEndLineInFile1;
25: private int m_nEndLineInFile2;
26: private String m_sFromText;
27: private String m_sToText;
28:
29: /**
30: * Creates a new Change object.
31: *
32: * @param nStartLineInFile1 DOCUMENT ME!
33: * @param nEndLineInFile1 DOCUMENT ME!
34: * @param nStartLineInFile2 DOCUMENT ME!
35: * @param nEndLineInFile2 DOCUMENT ME!
36: * @param sFromText DOCUMENT ME!
37: * @param sToText DOCUMENT ME!
38: */
39: public Change(int nStartLineInFile1, int nEndLineInFile1,
40: int nStartLineInFile2, int nEndLineInFile2,
41: String sFromText, String sToText) {
42: super (nStartLineInFile1, nStartLineInFile2);
43: m_nEndLineInFile1 = nEndLineInFile1;
44: m_nEndLineInFile2 = nEndLineInFile2;
45: m_sFromText = sFromText;
46: m_sToText = sToText;
47: }
48:
49: /**
50: * DOCUMENT ME!
51: *
52: * @return DOCUMENT ME!
53: */
54: public int getEndLineInFile1() {
55: return m_nEndLineInFile1;
56: }
57:
58: /**
59: * DOCUMENT ME!
60: *
61: * @return DOCUMENT ME!
62: */
63: public int getEndLineInFile2() {
64: return m_nEndLineInFile2;
65: }
66:
67: /**
68: * DOCUMENT ME!
69: *
70: * @return DOCUMENT ME!
71: */
72: public String getFromText() {
73: return m_sFromText;
74: }
75:
76: /**
77: * DOCUMENT ME!
78: *
79: * @return DOCUMENT ME!
80: */
81: public String getToText() {
82: return m_sToText;
83: }
84:
85: /**
86: * DOCUMENT ME!
87: *
88: * @return DOCUMENT ME!
89: */
90: public String toString() {
91: return getStartLineInFile1() + "," + getEndLineInFile1() + "c"
92: + getStartLineInFile2() + "," + getEndLineInFile2()
93: + "\n" + m_sFromText + "---\n" + m_sToText;
94: }
95: }
|