1 7 8 package jas; 9 10 import java.io.*; 11 import java.util.*; 12 13 public class ElemValPair { 14 15 AsciiCP name; 16 byte kind; 17 boolean noName; 18 19 void resolve(ClassEnv e){ 20 e.addCPItem(name); 21 } 22 23 27 public ElemValPair(String name, char kind) { this.name = new AsciiCP(name); 29 this.kind = (byte)kind; 30 } 31 32 int size(){ 33 if (noName) return 1; 34 return 3; 35 } 36 37 public void setNoName(){ 38 noName = true; 39 } 40 41 void write(ClassEnv e, DataOutputStream out) 42 throws IOException, jasError 43 { 44 45 if (!noName){ 46 out.writeShort(e.getCPIndex(name)); 47 } 48 out.writeByte(kind); 49 } 50 51 } 52 | Popular Tags |