soot.coffi
Class CONSTANT_Utf8_info

java.lang.Object
  |
  +--soot.coffi.cp_info
        |
        +--soot.coffi.CONSTANT_Utf8_info

public class CONSTANT_Utf8_info
extends soot.coffi.cp_info

A constant pool entry of type CONSTANT_Utf8; note this is not multithread safe. It is, however, immutable.

See Also:
cp_info

Fields inherited from class soot.coffi.cp_info
CONSTANT_Class, CONSTANT_Double, CONSTANT_Fieldref, CONSTANT_Float, CONSTANT_Integer, CONSTANT_InterfaceMethodref, CONSTANT_Long, CONSTANT_Methodref, CONSTANT_NameAndType, CONSTANT_String, CONSTANT_Utf8, tag
 
Constructor Summary
CONSTANT_Utf8_info(java.io.DataInputStream d)
          Constructor from a DataInputSream
 
Method Summary
 int compareTo(soot.coffi.cp_info cp)
          Compares this entry with another cp_info object; note that for Utf8 object it really doesn't matter whether they're in the same or a different constant pool, since they really do carry all their data.
 int compareTo(soot.coffi.cp_info[] constant_pool, soot.coffi.cp_info cp, soot.coffi.cp_info[] cp_constant_pool)
          Compares this entry with another cp_info object (which may reside in a different constant pool).
 java.lang.String convert()
          Converts internal representation into an actual String.
 boolean equals(CONSTANT_Utf8_info cu)
          Answers whether this utf8 string is the same as a given one.
 void fixConversion(java.lang.String rep)
          Fixes the actual String used to represent the internal representation.
 int length()
          Length in bytes of byte array.
 int size()
          Returns the size of this cp_info object.
 java.lang.String toString(soot.coffi.cp_info[] constant_pool)
          Returns a String representation of this entry.
static byte[] toUtf8(java.lang.String s)
          Utility method; converts the given String into a utf8 encoded array of bytes.
 java.lang.String typeName()
          Returns a String description of what kind of entry this is.
 void writeBytes(java.io.DataOutputStream dd)
          For writing out the byte stream for this utf8 properly (incl size).
 
Methods inherited from class soot.coffi.cp_info
countParams, fieldType, getClassname, getName, getTypeDescr, ints2long, printBits, printBits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CONSTANT_Utf8_info

public CONSTANT_Utf8_info(java.io.DataInputStream d)
                   throws java.io.IOException
Constructor from a DataInputSream
Method Detail

writeBytes

public void writeBytes(java.io.DataOutputStream dd)
                throws java.io.IOException
For writing out the byte stream for this utf8 properly (incl size).

length

public int length()
Length in bytes of byte array.

size

public int size()
Returns the size of this cp_info object.
Overrides:
size in class soot.coffi.cp_info
Returns:
number of bytes occupied by this object.
See Also:
cp_info.size()

convert

public java.lang.String convert()
Converts internal representation into an actual String.
Returns:
String version of this utf8 object.

fixConversion

public void fixConversion(java.lang.String rep)
Fixes the actual String used to represent the internal representation. We must have rep == convert(); we verify hashCodes() to spot-check this. No user-visible effects.

equals

public boolean equals(CONSTANT_Utf8_info cu)
Answers whether this utf8 string is the same as a given one.
Parameters:
cu - utf8 object with which to compare.
Returns:
true if they are equal, false if they are not.

compareTo

public int compareTo(soot.coffi.cp_info[] constant_pool,
                     soot.coffi.cp_info cp,
                     soot.coffi.cp_info[] cp_constant_pool)
Compares this entry with another cp_info object (which may reside in a different constant pool).
Overrides:
compareTo in class soot.coffi.cp_info
Parameters:
constant_pool - constant pool of ClassFile for this.
cp - constant pool entry to compare against.
cp_constant_pool - constant pool of ClassFile for cp.
Returns:
a value <0, 0, or >0 indicating whether this is smaller, the same or larger than cp.
See Also:
cp_info.compareTo(soot.coffi.cp_info[], soot.coffi.cp_info, soot.coffi.cp_info[]), compareTo(cp_info)

compareTo

public int compareTo(soot.coffi.cp_info cp)
Compares this entry with another cp_info object; note that for Utf8 object it really doesn't matter whether they're in the same or a different constant pool, since they really do carry all their data.
Parameters:
cp - constant pool entry to compare against.
Returns:
a value <0, 0, or >0 indicating whether this is smaller, the same or larger than cp.
See Also:
cp_info.compareTo(soot.coffi.cp_info[], soot.coffi.cp_info, soot.coffi.cp_info[]), compareTo(cp_info[],cp_info,cp_info[])

toUtf8

public static byte[] toUtf8(java.lang.String s)
Utility method; converts the given String into a utf8 encoded array of bytes.
Parameters:
s - String to encode.
Returns:
array of bytes, utf8 encoded version of s.

toString

public java.lang.String toString(soot.coffi.cp_info[] constant_pool)
Returns a String representation of this entry.
Overrides:
toString in class soot.coffi.cp_info
Parameters:
constant_pool - constant pool of ClassFile.
Returns:
String representation of this entry.
See Also:
cp_info.toString(soot.coffi.cp_info[])

typeName

public java.lang.String typeName()
Returns a String description of what kind of entry this is.
Overrides:
typeName in class soot.coffi.cp_info
Returns:
the String "utf8".
See Also:
cp_info.typeName()