|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.android.dx.rop.cst.Constant
com.android.dx.rop.cst.TypedConstant
com.android.dx.rop.cst.CstString
public final class CstString
Constants of type CONSTANT_Utf8_info or CONSTANT_String_info.
| Field Summary | |
|---|---|
static CstString |
EMPTY_STRING
non-null; instance representing "", that is, the
empty string |
| Constructor Summary | |
|---|---|
CstString(ByteArray bytes)
Constructs an instance from some UTF-8 bytes. |
|
CstString(String string)
Constructs an instance from a String. |
|
| Method Summary | |
|---|---|
protected int |
compareTo0(Constant other)
Compare the values of this and another instance, which are guaranteed to be of the same class. |
boolean |
equals(Object other)
|
ByteArray |
getBytes()
Gets the UTF-8 value as UTF-8 encoded bytes. |
String |
getString()
Gets the UTF-8 value as a string. |
Type |
getType()
Gets the type associated with this instance. |
int |
getUtf16Size()
Gets the size of this instance as UTF-16 code points. |
int |
getUtf8Size()
Gets the size of this instance as UTF-8 code points. |
int |
hashCode()
|
boolean |
isCategory2()
Returns true if this instance is a category-2 constant,
meaning it takes up two slots in the constant pool, or
false if this instance is category-1. |
static byte[] |
stringToUtf8Bytes(String string)
Converts a string into its MUTF-8 form. |
String |
toHuman()
Return the "human" string form of this instance. |
String |
toQuoted()
Gets the value as a human-oriented string, surrounded by double quotes. |
String |
toQuoted(int maxLength)
Gets the value as a human-oriented string, surrounded by double quotes, but ellipsizes the result if it is longer than the given maximum length |
String |
toString()
|
String |
typeName()
Returns the human name for the particular type of constant this instance is. |
static String |
utf8BytesToString(ByteArray bytes)
Converts an array of UTF-8 bytes into a string. |
| Methods inherited from class com.android.dx.rop.cst.TypedConstant |
|---|
getBasicFrameType, getBasicType, getFrameType, isConstant |
| Methods inherited from class com.android.dx.rop.cst.Constant |
|---|
compareTo |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final CstString EMPTY_STRING
non-null; instance representing "", that is, the
empty string
| Constructor Detail |
|---|
public CstString(String string)
String.
string - non-null; the UTF-8 value as a stringpublic CstString(ByteArray bytes)
bytes - non-null; array of the UTF-8 bytes| Method Detail |
|---|
public static byte[] stringToUtf8Bytes(String string)
string - non-null; the string to convert
non-null; the UTF-8 bytes for itpublic static String utf8BytesToString(ByteArray bytes)
bytes - non-null; the bytes to convert
non-null; the converted stringpublic boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Objectprotected int compareTo0(Constant other)
compareTo0 in class Constantother - non-null; the instance to compare to
-1, 0, or 1, as usual
for a comparisonpublic String toString()
toString in class Objectpublic String typeName()
typeName in class Constantnon-null; the namepublic boolean isCategory2()
true if this instance is a category-2 constant,
meaning it takes up two slots in the constant pool, or
false if this instance is category-1.
isCategory2 in class Constanttrue iff this instance is category-2public String toHuman()
toString().
non-null; the human string formpublic String toQuoted()
non-null; the quoted stringpublic String toQuoted(int maxLength)
maxLength - >= 5; the maximum length of the string to return
non-null; the quoted stringpublic String getString()
non-null; the UTF-8 value as a stringpublic ByteArray getBytes()
non-null; an array of the UTF-8 bytespublic int getUtf8Size()
>= 0; the UTF-8 sizepublic int getUtf16Size()
length of the
Java String representation of this instance.
>= 0; the UTF-16 sizepublic Type getType()
TypeBearer
non-null; the type
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||