00001 package de.fub.bytecode.classfile;
00002
00003 import de.fub.bytecode.Constants;
00004 import java.io.*;
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 public final class LineNumber implements Cloneable {
00016 private int start_pc;
00017 private int line_number;
00018
00019
00020
00021
00022
00023 public LineNumber(int start_pc, int line_number)
00024 {
00025 this.start_pc = start_pc;
00026 this.line_number = line_number;
00027 }
00028
00029
00030
00031 public LineNumber(LineNumber c) {
00032 this(c.getStartPC(), c.getLineNumber());
00033 }
00034
00035
00036
00037
00038
00039 LineNumber(DataInputStream file) throws IOException
00040 {
00041 this(file.readUnsignedShort(), file.readUnsignedShort());
00042 }
00043
00044
00045
00046
00047
00048
00049
00050 public void accept(Visitor v) {
00051 v.visitLineNumber(this);
00052 }
00053
00054
00055
00056 public LineNumber copy() {
00057 try {
00058 return (LineNumber)clone();
00059 } catch(CloneNotSupportedException e) {}
00060
00061 return null;
00062 }
00063
00064
00065
00066
00067
00068
00069 public final void dump(DataOutputStream file) throws IOException
00070 {
00071 file.writeShort(start_pc);
00072 file.writeShort(line_number);
00073 }
00074
00075
00076
00077 public final int getLineNumber() { return line_number; }
00078
00079
00080
00081 public final int getStartPC() { return start_pc; }
00082
00083
00084
00085 public final void setLineNumber(int line_number) {
00086 this.line_number = line_number;
00087 }
00088
00089
00090
00091 public final void setStartPC(int start_pc) {
00092 this.start_pc = start_pc;
00093 }
00094
00095
00096
00097 public final String toString()
00098 {
00099 return "LineNumber(" + start_pc + ", " + line_number + ")";
00100 }
00101 }