01: /* Copyright (C) 2004 - 2007 db4objects Inc. http://www.db4o.com
02:
03: This file is part of the db4o open source object database.
04:
05: db4o is free software; you can redistribute it and/or modify it under
06: the terms of version 2 of the GNU General Public License as published
07: by the Free Software Foundation and as clarified by db4objects' GPL
08: interpretation policy, available at
09: http://www.db4o.com/about/company/legalpolicies/gplinterpretation/
10: Alternatively you can write to db4objects, Inc., 1900 S Norfolk Street,
11: Suite 350, San Mateo, CA 94403, USA.
12:
13: db4o is distributed in the hope that it will be useful, but WITHOUT ANY
14: WARRANTY; without even the implied warranty of MERCHANTABILITY or
15: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16: for more details.
17:
18: You should have received a copy of the GNU General Public License along
19: with this program; if not, write to the Free Software Foundation, Inc.,
20: 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
21: package EDU.purdue.cs.bloat.reflect;
22:
23: /**
24: * LineNumberDebugInfo is used to map a range of instructions to a line number
25: * in the original Java source file. An instance of
26: * <tt>file.LineNumberTable</tt> contains an array of these guys.
27: *
28: * @see EDU.purdue.cs.bloat.file.LineNumberTable
29: *
30: * @author Nate Nystrom (<a
31: * href="mailto:nystrom@cs.purdue.edu">nystrom@cs.purdue.edu</a>)
32: */
33: public class LineNumberDebugInfo {
34: private int startPC;
35:
36: private int lineNumber;
37:
38: /**
39: * Constructor.
40: *
41: * @param startPC
42: * The start PC of the instructions for this line number.
43: * @param lineNumber
44: * The line number for this group of instructions.
45: */
46: public LineNumberDebugInfo(final int startPC, final int lineNumber) {
47: this .startPC = startPC;
48: this .lineNumber = lineNumber;
49: }
50:
51: /**
52: * Get the start PC of the instructions for this line number.
53: *
54: * @return The start PC.
55: */
56: public int startPC() {
57: return startPC;
58: }
59:
60: /**
61: * Get the line number for this group of instructions.
62: *
63: * @return The line number.
64: */
65: public int lineNumber() {
66: return lineNumber;
67: }
68:
69: /**
70: * Convert the attribute to a string.
71: *
72: * @return A string representation of the attribute.
73: */
74: public String toString() {
75: return "(line #" + lineNumber + " pc=" + startPC + ")";
76: }
77:
78: public Object clone() {
79: return (new LineNumberDebugInfo(this.startPC, this.lineNumber));
80: }
81: }
|