1 7 8 package jas; 9 10 import java.io.*; 11 import java.util.*; 12 13 public class EnclMethAttr { 14 15 static CP attr = new AsciiCP("EnclosingMethod"); 16 ClassCP cls; 17 NameTypeCP meth; 18 19 void resolve(ClassEnv e){ 20 e.addCPItem(attr); 21 e.addCPItem(cls); 22 e.addCPItem(meth); 23 } 24 25 30 public EnclMethAttr(String a, String b, String c) { cls = new ClassCP(a); 32 meth = new NameTypeCP(b, c); 33 } 34 35 int size(){ 36 return 4; 37 } 38 39 40 void write(ClassEnv e, DataOutputStream out) 41 throws IOException, jasError 42 { 43 44 out.writeShort(e.getCPIndex(attr)); 45 out.writeInt(4); out.writeShort(e.getCPIndex(cls)); 47 out.writeShort(e.getCPIndex(meth)); 48 } 49 } 50 | Popular Tags |