FileDocCategorySizeDatePackage
ConstantStringInfo.javaAPI DocJ2ME CLDC 1.12006Wed Feb 05 15:56:04 GMT 2003kdp.classparser.constantpoolclasses

ConstantStringInfo

public class ConstantStringInfo extends ConstantPoolInfo
Encapsulates a CONSTANT_String item a Java class file constant pool.
author
Aaron Dietrich
version
$Id: ConstantStringInfo.java,v 1.1.1.1 2000/07/07 13:34:24 jrv Exp $ Revision History $Log: ConstantStringInfo.java,v $ Revision 1.1.1.1 2000/07/07 13:34:24 jrv Initial import of kdp code Revision 1.1.1.1 2000/05/31 19:14:48 ritsun Initial import of kvmdt to CVS Revision 1.1 2000/04/25 00:34:06 ritsun Initial revision

Fields Summary
private int
stringIndex
index into constant pool containing a UTF8Info structure
Constructors Summary
public ConstantStringInfo(DataInputStream iStream)
Constructor. Creates a ConstantStringInfo object.

param
iStream input stream to read from
exception
IOException just pass IOExceptions up

      tag = ConstantPoolInfo.CONSTANT_String;
      
      stringIndex = iStream.readUnsignedShort ();
     
Methods Summary
public java.lang.StringtoString()
Returns this ConstantStringInfo's information as a string.

return
String info as a string

      return ("CONSTANT_String\t" + "stringIndex=\t" + stringIndex);
     
public java.lang.StringtoString(ConstantPoolInfo[] constantPool)
Returns the string referenced by this ConstantStringInfo object from the constant pool.

param
constantPool class's constant pool
return
String referenced string

      ConstantUtf8Info        utf8Info = (ConstantUtf8Info) constantPool[stringIndex];

      return ("CONSTANT_String=\t" + utf8Info.toString ());