1 25 26 package org.netbeans.modules.classfile; 27 28 29 34 public class CPNameAndTypeInfo extends CPEntry { 35 int iName; 36 int iDesc; 37 38 CPNameAndTypeInfo(ConstantPool pool,int iName,int iDesc) { 39 super(pool); 40 this.iName = iName; 41 this.iDesc = iDesc; 42 } 43 44 protected CPNameAndTypeInfo(ConstantPool pool) { 45 super(pool); 46 iName = CPName.INVALID_INDEX; 47 iDesc = CPName.INVALID_INDEX; 48 } 49 50 public final String getName() { 51 return ((CPName)pool.cpEntries[iName]).getName(); 52 } 53 54 void setNameIndex(int index) { 55 iName = index; 56 } 57 58 public final String getDescriptor() { 59 return ((CPName)pool.cpEntries[iDesc]).getName(); 60 } 61 62 void setDescriptorIndex(int index) { 63 iDesc = index; 64 } 65 66 public int getTag() { 67 return ConstantPool.CONSTANT_NameAndType; 68 } 69 70 public String toString() { 71 return getClass().getName() + ": name=" + getName() + ", descriptor=" + getDescriptor(); } 74 } 75 | Popular Tags |