1 8 9 package jas; 10 11 import java.io.*; 12 13 14 public class FieldCP extends CP implements RuntimeConstants 15 { 16 ClassCP clazz; 17 NameTypeCP nt; 18 19 30 31 public FieldCP(String clazz, String name, String sig) 32 { 33 uniq = (clazz + "&%$#&" + name + "*()#$" + sig).intern(); 34 this.clazz = new ClassCP(clazz); 35 this.nt = new NameTypeCP(name, sig); 36 } 37 38 void resolve(ClassEnv e) 39 { 40 e.addCPItem(clazz); 41 e.addCPItem(nt); 42 } 43 44 void write(ClassEnv e, DataOutputStream out) 45 throws IOException, jasError 46 { 47 out.writeByte(CONSTANT_FIELD); 48 out.writeShort(e.getCPIndex(clazz)); 49 out.writeShort(e.getCPIndex(nt)); 50 } 51 } 52 | Popular Tags |