net.sf.rej.java.constantpool
Class StringInfo

java.lang.Object
  extended by net.sf.rej.java.constantpool.ConstantPoolInfo
      extended by net.sf.rej.java.constantpool.StringInfo

public class StringInfo
extends ConstantPoolInfo

Represents a String Info entry in the constant pool.

Author:
Sami Koivu

Field Summary
 
Fields inherited from class net.sf.rej.java.constantpool.ConstantPoolInfo
CLASS, DOUBLE, FIELD_REF, FLOAT, INTEGER, INTERFACE_METHOD_REF, LONG, METHOD_REF, NAME_AND_TYPE, STRING, UTF8
 
Constructor Summary
StringInfo(int stringIndex, ConstantPool pool)
           
 
Method Summary
 void createNewUTF8String(java.lang.String newString)
           
 boolean equals(java.lang.Object other)
           
 byte[] getData()
          Return the data of this entry in the form that it can be written to a class file.
 java.lang.String getString()
           
 java.lang.String getStringValue()
           
 java.lang.String getTypeString()
          Return a String describing the type of this instance.
 int getUTF8Index()
           
 UTF8Info getUTF8Info()
           
 java.lang.String getValue()
          Return a String representation of the value of this constant pool entry.
 int hashCode()
           
 void setUTF8Index(int index)
           
 java.lang.String toString()
           
 
Methods inherited from class net.sf.rej.java.constantpool.ConstantPoolInfo
getCPI, getType
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringInfo

public StringInfo(int stringIndex,
                  ConstantPool pool)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getData

public byte[] getData()
Description copied from class: ConstantPoolInfo
Return the data of this entry in the form that it can be written to a class file.

Specified by:
getData in class ConstantPoolInfo
Returns:
byte[] array with data

getString

public java.lang.String getString()

getValue

public java.lang.String getValue()
Description copied from class: ConstantPoolInfo
Return a String representation of the value of this constant pool entry. Each subclass overwrites this method and returns a value that makes sense for it's context.

Overrides:
getValue in class ConstantPoolInfo
Returns:
String value of this entry

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

getTypeString

public java.lang.String getTypeString()
Description copied from class: ConstantPoolInfo
Return a String describing the type of this instance.

Specified by:
getTypeString in class ConstantPoolInfo
Returns:
The type of this entry as a String.

getStringValue

public java.lang.String getStringValue()

getUTF8Info

public UTF8Info getUTF8Info()

getUTF8Index

public int getUTF8Index()

createNewUTF8String

public void createNewUTF8String(java.lang.String newString)

setUTF8Index

public void setUTF8Index(int index)