1 23 24 25 package com.sun.jdo.api.persistence.enhancer.classfile; 26 27 import java.io.*; 28 29 33 34 public abstract class ConstBasicMemberRef extends ConstBasic { 35 36 protected ConstClass theClassName; 37 38 40 protected int theClassNameIndex; 41 42 43 protected ConstNameAndType theNameAndType; 44 45 47 protected int theNameAndTypeIndex; 48 49 50 51 54 public ConstClass className() { 55 return theClassName; 56 } 57 58 61 public ConstNameAndType nameAndType() { 62 return theNameAndType; 63 } 64 65 public String toString () { 66 return "className(" + theClassName.toString() + ")" + " nameAndType(" + theNameAndType.toString() + ")"; } 69 70 71 72 75 ConstBasicMemberRef (ConstClass cname, ConstNameAndType NT) { 76 theClassName = cname; 77 theNameAndType = NT; 78 } 79 80 83 ConstBasicMemberRef (int cnameIndex, int NT_index) { 84 theClassNameIndex = cnameIndex; 85 theNameAndTypeIndex = NT_index; 86 } 87 88 void formatData (DataOutputStream b) throws IOException { 89 b.writeShort(theClassName.getIndex()); 90 b.writeShort(theNameAndType.getIndex()); 91 } 92 void resolve (ConstantPool p) { 93 theClassName = (ConstClass) p.constantAt(theClassNameIndex); 94 theNameAndType = (ConstNameAndType) p.constantAt(theNameAndTypeIndex); 95 } 96 } 97 98 | Popular Tags |