harpoon.IR.RawClass
Class ConstantUtf8

java.lang.Object
  extended by harpoon.IR.RawClass.Constant
      extended by harpoon.IR.RawClass.ConstantUtf8

public class ConstantUtf8
extends Constant

The CONSTANT_Utf8_info structure is used to represent constant string values.

UTF-8 strings are encoded so that character sequences that contain only non-null ASCII characters can be represented using only one byte per character, but characters of up to 16 bits can be represented.

Version:
$Id: ConstantUtf8.java,v 1.2 2002/02/25 21:05:27 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
"The Java Virtual Machine Specification, section 4.4.7", Constant

Field Summary
 String val
          The value of the string constant
 
Fields inherited from class harpoon.IR.RawClass.Constant
parent
 
Constructor Summary
ConstantUtf8(ClassFile parent, String val)
          Constructor.
 
Method Summary
 String toString()
          Create a human-readable representation of this constant.
 void write(ClassDataOutputStream out)
          Write to a bytecode file.
 
Methods inherited from class harpoon.IR.RawClass.Constant
entrySize, print, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

val

public String val
The value of the string constant

Constructor Detail

ConstantUtf8

public ConstantUtf8(ClassFile parent,
                    String val)
Constructor.

Method Detail

write

public void write(ClassDataOutputStream out)
           throws IOException
Write to a bytecode file.

Specified by:
write in class Constant
Throws:
IOException - on error writing to output stream.

toString

public String toString()
Create a human-readable representation of this constant.

Overrides:
toString in class Constant