1 9 package com.vladium.jcd.cls.attribute; 10 11 import java.io.IOException ; 12 13 import com.vladium.jcd.compiler.IClassFormatOutput; 14 import com.vladium.jcd.lib.UDataInputStream; 15 import com.vladium.jcd.lib.UDataOutputStream; 16 17 56 public 57 final class Exception_info implements Cloneable , IClassFormatOutput 58 { 59 61 62 public int m_start_pc, m_end_pc, m_handler_pc, m_catch_type; 63 64 65 public Exception_info (final int start_pc, final int end_pc, 66 final int handler_pc, final int catch_type) 67 { 68 m_start_pc = start_pc; 69 m_end_pc = end_pc; 70 m_handler_pc = handler_pc; 71 m_catch_type = catch_type; 72 } 73 74 75 public String toString () 76 { 77 return "exception_info: [start_pc/end_pc = " + m_start_pc + '/' + m_end_pc + 78 ", handler_pc = " + m_handler_pc + 79 ", catch_type = " + m_catch_type + ']'; 80 } 81 82 84 87 public Object clone () 88 { 89 try 90 { 91 return super.clone (); 92 } 93 catch (CloneNotSupportedException e) 94 { 95 throw new InternalError (e.toString ()); 96 } 97 } 98 99 101 public void writeInClassFormat (final UDataOutputStream out) throws IOException 102 { 103 out.writeU2 (m_start_pc); 104 out.writeU2 (m_end_pc); 105 out.writeU2 (m_handler_pc); 106 out.writeU2 (m_catch_type); 107 } 108 109 111 113 114 Exception_info (final UDataInputStream bytes) throws IOException 115 { 116 m_start_pc = bytes.readU2 (); 117 m_end_pc = bytes.readU2 (); 118 m_handler_pc = bytes.readU2 (); 119 m_catch_type = bytes.readU2 (); 120 } 121 122 124 } | Popular Tags |