Package com.android.dx.dex.file
Class StringIdsSection
java.lang.Object
com.android.dx.dex.file.Section
com.android.dx.dex.file.UniformItemSection
com.android.dx.dex.file.StringIdsSection
Strings list section of a
.dex
file.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the item corresponding to the givenConstant
.int
Gets the index of the given string, which must have been added to this instance.intern
(StringIdItem string) Interns an element into this instance.void
Interns the components of a name-and-type into this instance.Interns an element into this instance.Interns an element into this instance.Collection
<? extends Item> items()
Gets the collection of all the items in this section.protected void
Alters or picks the order for items in this instance if desired, so that subsequent calls toSection.items()
will yield a so-ordered collection.void
Writes the portion of the file header that refers to this instance.Methods inherited from class com.android.dx.dex.file.UniformItemSection
getAbsoluteItemOffset, prepare0, writeSize, writeTo0
Methods inherited from class com.android.dx.dex.file.Section
align, getAbsoluteOffset, getAlignment, getFile, getFileOffset, getName, prepare, setFileOffset, throwIfNotPrepared, throwIfPrepared, validateAlignment, writeTo
-
Constructor Details
-
StringIdsSection
Constructs an instance. The file offset is initially unknown.- Parameters:
file
-non-null;
file that this instance is part of
-
-
Method Details
-
items
Gets the collection of all the items in this section. It is not valid to attempt to change the returned list. -
get
Gets the item corresponding to the givenConstant
. This will throw an exception if the constant is not found, including if this instance isn't the sort that maps constants toIndexedItem
instances.- Specified by:
get
in classUniformItemSection
- Parameters:
cst
-non-null;
constant to look for- Returns:
non-null;
the corresponding item found in this instance
-
writeHeaderPart
Writes the portion of the file header that refers to this instance.- Parameters:
out
-non-null;
where to write
-
intern
Interns an element into this instance.- Parameters:
string
-non-null;
the string to intern, as a regular JavaString
- Returns:
non-null;
the interned string
-
intern
Interns an element into this instance.- Parameters:
string
-non-null;
the string to intern, as a constant- Returns:
non-null;
the interned string
-
intern
Interns an element into this instance.- Parameters:
string
-non-null;
the string to intern- Returns:
non-null;
the interned string
-
intern
Interns the components of a name-and-type into this instance.- Parameters:
nat
-non-null;
the name-and-type
-
indexOf
Gets the index of the given string, which must have been added to this instance.- Parameters:
string
-non-null;
the string to look up- Returns:
>= 0;
the string's index
-
orderItems
protected void orderItems()Alters or picks the order for items in this instance if desired, so that subsequent calls toSection.items()
will yield a so-ordered collection. If the items in this instance are indexed, then this method should also assign indices.- Specified by:
orderItems
in classUniformItemSection
-