1 package com.sun.org.apache.bcel.internal.classfile; 2 3 56 57 import com.sun.org.apache.bcel.internal.Constants; 58 import java.io.*; 59 60 69 public final class LineNumber implements Cloneable , Node { 70 private int start_pc; private int line_number; 73 76 public LineNumber(LineNumber c) { 77 this(c.getStartPC(), c.getLineNumber()); 78 } 79 80 85 LineNumber(DataInputStream file) throws IOException 86 { 87 this(file.readUnsignedShort(), file.readUnsignedShort()); 88 } 89 90 94 public LineNumber(int start_pc, int line_number) 95 { 96 this.start_pc = start_pc; 97 this.line_number = line_number; 98 } 99 100 107 public void accept(Visitor v) { 108 v.visitLineNumber(this); 109 } 110 111 117 public final void dump(DataOutputStream file) throws IOException 118 { 119 file.writeShort(start_pc); 120 file.writeShort(line_number); 121 122 } 123 126 public final int getLineNumber() { return line_number; } 127 128 131 public final int getStartPC() { return start_pc; } 132 133 136 public final void setLineNumber(int line_number) { 137 this.line_number = line_number; 138 } 139 140 143 public final void setStartPC(int start_pc) { 144 this.start_pc = start_pc; 145 } 146 147 150 public final String toString() { 151 return "LineNumber(" + start_pc + ", " + line_number + ")"; 152 } 153 154 157 public LineNumber copy() { 158 try { 159 return (LineNumber)clone(); 160 } catch(CloneNotSupportedException e) {} 161 162 return null; 163 } 164 } 165 | Popular Tags |