1 26 package com.yworks.yguard.obf.classfile; 27 28 import java.io.*; 29 import java.util.*; 30 31 36 public class NameAndTypeCpInfo extends CpInfo implements Cloneable 37 { 38 40 41 private int u2nameIndex; 43 private int u2descriptorIndex; 44 45 46 48 49 protected NameAndTypeCpInfo() 51 { 52 super(CONSTANT_NameAndType); 53 } 54 55 56 public Object clone() 57 { 58 NameAndTypeCpInfo cloneInfo = new NameAndTypeCpInfo(); 59 cloneInfo.u2nameIndex = this.u2nameIndex; 60 cloneInfo.u2descriptorIndex = this.u2descriptorIndex; 61 cloneInfo.resetRefCount(); 62 return cloneInfo; 63 } 64 65 66 protected int getNameIndex() {return u2nameIndex;} 67 68 69 protected void setNameIndex(int index) {u2nameIndex = index;} 70 71 72 protected int getDescriptorIndex() {return u2descriptorIndex;} 73 74 75 protected void setDescriptorIndex(int index) {u2descriptorIndex = index;} 76 77 78 protected void markUtf8Refs(ConstantPool pool) 79 { 80 pool.incRefCount(u2nameIndex); 81 pool.incRefCount(u2descriptorIndex); 82 } 83 84 85 protected void readInfo(DataInput din) throws java.io.IOException 86 { 87 u2nameIndex = din.readUnsignedShort(); 88 u2descriptorIndex = din.readUnsignedShort(); 89 } 90 91 92 protected void writeInfo(DataOutput dout) throws java.io.IOException 93 { 94 dout.writeShort(u2nameIndex); 95 dout.writeShort(u2descriptorIndex); 96 } 97 } 98 | Popular Tags |