1 32 33 package com.jeantessier.classreader; 34 35 import java.io.*; 36 37 import org.apache.log4j.*; 38 39 public class LineNumber implements Visitable { 40 private LineNumberTable_attribute lineNumberTable; 41 private int startPC; 42 private int lineNumber; 43 44 public LineNumber(LineNumberTable_attribute lineNumberTable, DataInputStream in) throws IOException { 45 setLineNumberTable(lineNumberTable); 46 47 startPC = in.readUnsignedShort(); 48 Logger.getLogger(getClass()).debug("Line number table start PC: " + startPC); 49 50 lineNumber = in.readUnsignedShort(); 51 Logger.getLogger(getClass()).debug("Line number: " + lineNumber); 52 } 53 54 public LineNumberTable_attribute getLineNumberTable() { 55 return lineNumberTable; 56 } 57 58 private void setLineNumberTable(LineNumberTable_attribute lineNumberTable) { 59 this.lineNumberTable = lineNumberTable; 60 } 61 62 public int getStartPC() { 63 return startPC; 64 } 65 66 public int getLineNumber() { 67 return lineNumber; 68 } 69 70 public String toString() { 71 return "Line number"; 72 } 73 74 public void accept(Visitor visitor) { 75 visitor.visitLineNumber(this); 76 } 77 } 78 | Popular Tags |