1 32 33 package com.jeantessier.classreader; 34 35 import java.io.*; 36 37 public class String_info extends ConstantPoolEntry { 38 private int valueIndex; 39 40 public String_info(ConstantPool constantPool, DataInputStream in) throws IOException { 41 super(constantPool); 42 43 valueIndex = in.readUnsignedShort(); 44 } 45 46 public int getValueIndex() { 47 return valueIndex; 48 } 49 50 public UTF8_info getRawValue() { 51 return (UTF8_info) getConstantPool().get(getValueIndex()); 52 } 53 54 public String getValue() { 55 return getRawValue().toString(); 56 } 57 58 public String toString() { 59 return getValue(); 60 } 61 62 public void accept(Visitor visitor) { 63 visitor.visitString_info(this); 64 } 65 } 66 | Popular Tags |