Package com.android.dx.dex.file
Class StringIdItem
java.lang.Object
com.android.dx.dex.file.Item
com.android.dx.dex.file.IndexedItem
com.android.dx.dex.file.StringIdItem
- All Implemented Interfaces:
Comparable<StringIdItem>
Representation of a string inside a Dalvik file.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addContents
(DexFile file) Populates aDexFile
with items from within this instance.int
compareTo
(StringIdItem other) boolean
getData()
Gets the associated data object for this instance, if known.getValue()
Gets the string value.int
hashCode()
itemType()
Returns the item type for this instance.int
Gets the size of this instance when written, in bytes.void
writeTo
(DexFile file, AnnotatedOutput out) Writes the representation of this instance to the given data section, using the givenDexFile
to look things up as needed.Methods inherited from class com.android.dx.dex.file.IndexedItem
getIndex, hasIndex, indexString, setIndex
-
Constructor Details
-
StringIdItem
Constructs an instance.- Parameters:
value
-non-null;
the string value
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<StringIdItem>
-
itemType
Returns the item type for this instance. -
writeSize
public int writeSize()Gets the size of this instance when written, in bytes. -
addContents
Populates aDexFile
with items from within this instance. This will not add an item to the file for this instance itself (which should have been done by whatever refers to this instance).Note: Subclasses must override this to do something appropriate.
- Specified by:
addContents
in classItem
- Parameters:
file
-non-null;
the file to populate
-
writeTo
Writes the representation of this instance to the given data section, using the givenDexFile
to look things up as needed. If this instance keeps track of its offset, then this method will note the written offset and will also throw an exception if this instance has already been written. -
getValue
Gets the string value.- Returns:
non-null;
the value
-
getData
Gets the associated data object for this instance, if known.- Returns:
null-ok;
the associated data object ornull
if not yet known
-