1 7 8 package jas; 9 10 import java.io.*; 11 import java.util.*; 12 13 public class EnumElemValPair extends ElemValPair { 14 15 AsciiCP tval; 16 AsciiCP cval; 17 18 void resolve(ClassEnv e){ 19 super.resolve(e); 20 e.addCPItem(tval); 21 e.addCPItem(cval); 22 } 23 24 28 public EnumElemValPair(String name, char kind, String tval, String cval) { super(name, kind); 30 this.tval = new AsciiCP(tval); 31 this.cval = new AsciiCP(cval); 32 } 33 34 int size(){ 35 return super.size() + 4; 36 } 37 38 39 void write(ClassEnv e, DataOutputStream out) 40 throws IOException, jasError 41 { 42 super.write(e, out); 43 out.writeShort(e.getCPIndex(tval)); 44 out.writeShort(e.getCPIndex(cval)); 45 } 46 } 47 | Popular Tags |